Websoket Client for Java and Python


#1

Hello, I would like to know it there is any java or python client libraries support for adonis websockets like it is for socket.io @virk


#2

Currently there are no Java or Python clients. However, if someone wants to write one, I’ll be more than happy to help


#3

In your docs at Github https://github.com/adonisjs/adonis-websocket-protocol you say that adonis websocket uses https://github.com/websockets/ws library, well I did a google search and found a couple of client libraries for both java and python. i.e https://pypi.org/project/websocket-client/ and http://www.baeldung.com/websockets-api-java-spring-client what do say about this, or there is something that am still not getting :slight_smile:


#4

hello :slight_smile:
there is lots of libreries to use websocket in deferent languages ;the only thing is deferent is how to subscribe into the channals,fo example i test any websocket by this extension https://chrome.google.com/webstore/detail/smart-websocket-client/omalebghpgejjiaoknljcfmglgbpocdp
,So i tested my adonisJS project the result was like this every time :{"t":0,"d":{"connId":"cjkl........6r2j2tkoq","serverInterval":30000,"serverAttempts":3,"clientInterval":25000,"clientAttempts":3}}, how to send the data to my channal ?;I want to know the algorithem used in adonis-ws.js librery to access the channals ,after that anybody can create the alternative lib with any language
hope the devs understand my bad En language :sweat_smile:


#5

it indeed use websocket/ws under the hood, but it also implement a channel or room layout by normalizing the payload. The webSocket spec per se is only a message transport layer. No room, no state, just messages between a and b. To use the adonis websocket package, you would need to implement the logic described there