3 ms·
I'm not sure I see how you can connect to an irc server directly from the browser without some sort of proxy. You can't do TCP from js.
by Wilya 14y ago
I'm not sure I see how you can connect to an irc server directly from the browser without some sort of proxy. You can't do TCP from js.
- de90 14y agoWhat about WebSockets, aren't they TCP?
- Wilya 14y agoNot directly. More like TCP-like messaging over HTTP. The server needs to understand the websockets protocol. Writing a basic server that strips the websockets part from messages and forwards them to a real TCP server isn't very hard, but it's still a server you need.
- icebraining 14y agoIt's not really "over HTTP", it's just an HTTP handshake: The WebSocket Protocol is an independent TCP-based protocol. Its only relationship to HTTP is that its handshake is interpreted by HTTP servers as an Upgrade request. http://tools.ietf.org/html/rfc6455#section-1.7 http://tools.ietf.org/html/rfc6455#section-1.7
- daleharvey 14y agoboth chrome and firefox have tcp sockets apis, they are only usable in specific contexts, but you can write a web based irc client (there are a few around)
- Wilya 14y agoI stand corrected. Though as far as I can tell, it works only for apps in the chrome case[0] , and privileged web apps in firefox case[1]. [0] http://developer.chrome.com/apps/socket.html http://developer.chrome.com/apps/socket.html [1] https://wiki.mozilla.org/WebAPI/Security/TCPSocket https://wiki.mozilla.org/WebAPI/Security/TCPSocket
- malandrew 14y agoFWIW the System Applications Working Group at the W3C is working on a Raw Sockets spec for the browser, but I don't think a final draft will be ready until 2014. Adoption across most browsers will then take a little longer.