Re:Python HTTP library 'urllib3' now works in the browser
by SushiHippie on Tuesday January 30, 2024 @12:49PM
(#39193227)
Do you know if there are some plans for sockets or TLS APIs or are we far away from this?
[ Parent
| on HN ]
Re:Python HTTP library 'urllib3' now works in the browser
by SethMLarson on Tuesday January 30, 2024 @12:56PM
(#39193323)
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
by SushiHippie on Tuesday January 30, 2024 @02:43PM
(#39194704)
Sure, sorry if it wasn't clear from my question, it wasn't specifically about urllib3, but I meant if there are plans that browsers will make such an API available or if this is something that will never become real.
Re:Python HTTP library 'urllib3' now works in the browser
by sillysaurusx on Tuesday January 30, 2024 @03:27PM
(#39195303)
I doubt browsers would allow this, though gamedevs have wanted it for decades now. Particularly UDP.
Re:Python HTTP library 'urllib3' now works in the browser
by plopz on Tuesday January 30, 2024 @03:47PM
(#39195591)
isn't the udp problem fixed with http3 unreliable webtransport?
Re:Python HTTP library 'urllib3' now works in the browser
by sillysaurusx on Tuesday January 30, 2024 @03:53PM
(#39195669)
Is it? That would be cool. Under the hood is it actual udp?
Re:Python HTTP library 'urllib3' now works in the browser
by SushiHippie on Tuesday January 30, 2024 @05:53PM
(#39197089)
HTTP3 uses QUIC, it's not "pure" UDP, but it's a protocol based on it
Re:Python HTTP library 'urllib3' now works in the browser
by plopz on Tuesday January 30, 2024 @07:27PM
(#39198046)
its udp with encryption and congestion control, but the aspects that gamedevs like about udp, low latency and out of order delivery without head of line blocking are features
https://developer.chrome.com/docs/capabilities/web-apis/webt...