38 ms·
I don’t program web sites or web browsers, but with wasm or web sockets can’t you make a web page that opens a connection and sends arbitrary binary data to ano
by liketochill 5y ago
I don’t program web sites or web browsers, but with wasm or web sockets can’t you make a web page that opens a connection and sends arbitrary binary data to another server without any http?
- notamy 5y ago> but with wasm or web sockets can’t you make a web page that opens a connection and sends arbitrary binary data to another server without any http? I can't speak to WASM, but websockets are literally just a layer over HTTP in some regards -- a websocket connection is initiated by sending an HTTP request with the Upgrade header.
- ForHackernews 5y agoYou watch, eventually everything be a layer over HTTPS[0], and 443 will be the only port. RIP Internet. [0] https://en.wikipedia.org/wiki/DNS_over_HTTPS https://en.wikipedia.org/wiki/DNS_over_HTTPS
- handrous 5y agoLast I checked you'd still be speaking HTTP (even if it's "WebSockets"), not raw TCP. Certainly there's no UDP support. You'd need a translating proxy of some kind.
- duskwuff 5y agoNo. WebSockets are a specific protocol tunneled over HTTP, not raw sockets, and WASM doesn't expose any functionality which wasn't already available to JS.
- liketochill 5y agoWebrtc?
- tyingq 5y agoYou could make something similar to FTP with that, but it wouldn't be interoperable. Web browsers just don't expose a generic socket api where you can specify ports, bind(), listen(), accept(), connect(), and so on. So you can't make generic socket clients or servers. XHR, websockets, webrtc, and so on might be able to connect to a specific port, but they send things that would cause errors, and can't send/receive arbitrarily crafted sequences of data.