Can I connect to the services irc, icq, sip, etc. Using WebSockets, if I have some implementation of these protocols in JavaScript?

I would like to connect to the services irc, icq, sip, etc. using WebSockets. Assuming I have some implementation of these protocols in JavaScript? Is it possible? I don't seem to understand the limitations of WebSockets compared to regular sockets.

+6
source share
5 answers

No, you cannot, at least not directly.

WebSockets allows real-time messaging between the browser and the WebSocket server, but they have their own layer 7 protocol to encapsulate these messages.

They do not provide access to pure TCP (or UDP) sockets through which you can implement existing protocols.

+7
source

Absolutely!

The caveat is that you need something that is necessary for the connection between the browser WebSocket transport protocol and the raw TCP socket of the existing service. For example, something like websockify (disclaimer: I created websockify). Another caveat is that websockify only supports TCP targets (only WebSocket is TCP, so UDP target support will be a bit odd).

The websockify project actually includes two proofs of the concept of HTML / Javascript pages for interacting with IRC and telnet. If you are interested in using websockify to create HTML / Javascript clients for some common TCP protocols, I would even pull them into the websockify repository as examples (assuming they are well encoded and are under an open source license.

An alternative to websockify is to integrate websocket server-side support directly onto the servers you want to communicate with. It is not so difficult to add support. WebSocket has a very simple framework, and although the handshake is compatible with HTTP servers, it is actually much more limited and simple and does not require a full HTTP parser. For example, libvncserver 0.9.9 now supports both regular VNC connections and VNC connections via WebSocket. This allows noVNC (which I also created) to connect directly to the libvncserver based VNC server without requiring websockify.

+8
source

Inspircd has an unofficial module that you can install called m_websockets to allow the connection. The server on which the module is installed and configured allows you to connect to the server through web banners.

https://github.com/barosl/inspircd-m_websocket

+1
source

Expanding on @kanaka websockify, this project seems to do this:

HTML5 irc client created using websocket and websockify.

[Has] support for auto join, privmsg channel, themes, connections, user list, parts, nickname.

https://github.com/confact/dunirc

0
source

No, not with websockets, but you can with http.

Kamkar himself talked about this black hat .

-1
source

Source: https://habr.com/ru/post/918796/


All Articles