Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use WebSocket for server-server communication

Tags:

java

websocket

I currently research WebSockets. I noticed that all tutorials are for client being web browser and server, well, being server.

It should be possible to have two servers (frontend + backend) that communicate between each other using WebSocket, right? If so, may I get some example/tutorial/page where this kind of thing is described (especially "client" side)? I cannot find this anywhere.

I use Java 1.7, server is Wildfly 8.0.

like image 526
Mader Levap Avatar asked May 14 '26 06:05

Mader Levap


1 Answers

One of them is still client and the other server, as far as the WebSocket protocol is concerned. One of them, the server, listen on a TCP port and accepts connections from clients. The other, the client, initiates a connection to the server.

These two parts can both run on server machines but it doesn't change the fact that one acts as a client to the other.

I found multiple tutorials when searching for "Java websocket client" so I don't think I need to point to one specific. Pick the library that fits your needs best.

like image 82
Emil Vikström Avatar answered May 15 '26 21:05

Emil Vikström



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!