Python HTTP library 'urllib3' now works in the browser
11–20 of 35 posts
Re: Python HTTP library 'urllib3' now works in the browser
#12why would you want to run python in the browser? Anyone can ELI5?
Re: Python HTTP library 'urllib3' now works in the browser
#13Pyodide examples using urllib3 in browser still requires using fetch, so this still requires javascript. What does this practically mean? Does this ever point to a future where we can use urlib3 instead of fetch?
Lead maintainer of urllib3 here: We're tracking all the options for how we can make the experience better for folks looking to use Python in the browser. Today our biggest blocker is that there's no socket or TLS APIs for Emscripten/WASI. If those were to become available we'd jump on them right away :) I think the biggest benefit of a foundational project like urllib3 getting browser support is that /many/ Python pr…
Re: Python HTTP library 'urllib3' now works in the browser
#14Re: Python HTTP library 'urllib3' now works in the browser
#15Since this is using fetch/XHR under the hood, I guess requests from the browser are restricted only to same-origin URLs or servers responding with permissive CORS headers?
`data = urllib3.request("GET", "https://api.github.com").json()`
Re: Python HTTP library 'urllib3' now works in the browser
#16Pyodide examples using urllib3 in browser still requires using fetch, so this still requires javascript. What does this practically mean? Does this ever point to a future where we can use urlib3 instead of fetch?
Lead maintainer of urllib3 here: We're tracking all the options for how we can make the experience better for folks looking to use Python in the browser. Today our biggest blocker is that there's no socket or TLS APIs for Emscripten/WASI. If those were to become available we'd jump on them right away :) I think the biggest benefit of a foundational project like urllib3 getting browser support is that /many/ Python pr…
Big Tech does not like independent protocol operation it seems; therefore your interesting technical advance is likely to be a pawn in other, larger changes to the social contracts on the open net IMHO
Re: Python HTTP library 'urllib3' now works in the browser
#17why would you want to run python in the browser? Anyone can ELI5?
- Interactive documentation (static website)
- Jupyter Notebooks without a server, great for education (Jupyter-Lite)
- Python app alternative deployment as static webapp
Re: Python HTTP library 'urllib3' now works in the browser
#18why would you want to run python in the browser? Anyone can ELI5?
Re: Python HTTP library 'urllib3' now works in the browser
#19Earlier quoted context omitted.
Do you know if there are some plans for sockets or TLS APIs or are we far away from this?
Browsers limit the ability for these platforms to use raw sockets, there simply is no API for it. The best that can be done /today/ is to use WebSockets, which are not the same thing and can't be used for HTTP requests without the server expecting a WebSocket connection: https://github.com/emscripten-core/emscripten/issues/5196#is...
Re: Python HTTP library 'urllib3' now works in the browser
#20why would you want to run python in the browser? Anyone can ELI5?