Gunslinger
Gunslinger

Reputation: 1521

html5 WebSocket

I already have a server with port and want to write a web app to get the information form the port. Will this be possible with WebPorts?

The Client doesn't even need to talk back to the server, which is the whole point of websockets I would imagine, but since I already have the ports setup, I might be easier and cleaner to just connect and get the info without having to refresh.

Upvotes: 2

Views: 5406

Answers (2)

Alnitak
Alnitak

Reputation: 339985

WebSockets are not intended as clear TCP channels over which other existing protocols can be implemented.

WebSockets are designed to allow messages to be sent between a client and server, where an event is raised each time a message is received.

Hence a WebSocket client cannot simply connect to an existing TCP server - that server also has to speak the WebSocket protocol.

You could of course write a WebSocket-based server that does nothing but act as a proxy to existing network services.

Upvotes: 2

kanaka
kanaka

Reputation: 73217

I think you want websockify which is a WebSocket to plain TCP socket bridge/proxy. It also allows sending and receiving of binary data with the older version of the WebSocket protocol which hadn't yet added direct binary data support.

Disclaimer: I created websockify.

Upvotes: 2

Related Questions