2

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.

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

6 Comments

Thank you exactly the answer I was looking for
I agree that you need a WebSocket server or gateway of some sort. However, you can definitely extend the reach of business protocols on top of WebSockets all the way to the browser. Examples for existing protocols and APIs over WebSockets include XMPP, JMS, AMQP.
@PeterMoskovits sure, you can use a WebSocket gateway to act as a proxy between a web app and an existing socket socket.
Here's the updated link to the Kaazing WebSocket Gateway: kaazing.com/download
The claim in the first sentence is not correct. There are stream APIs available for both client and server, not just event-based ones. However it certainly is a protocol of its own with its own framing, so you need a WebSocket implemetation at both ends.
|
2

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.

1 Comment

Would that be a 'claimer' instead? ;)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.