Search code examples
javawebsockettwitch

StreamLabs socket API using Java


I am trying to connect to streamLabs socket API using Java. The API url is

https://sockets.streamlabs.com?token=<socketToken>

This doesnt work because Java expects the socket to be ws://.... When I change it to "ws" format it gives a connection timeout.

Am I missing something? Is this not actually a websocket, if not how would it work?

Here is a link to their documentation: https://streamlabs.readme.io/docs/socket-api

More info: I have tried with both org.asynchttpclient.ws.WebSocket and javax.websocket neither are working


Solution

  • Solved using SocketIo

    <dependency>
         <groupId>io.socket</groupId>
         <artifactId>socket.io-client</artifactId>
         <version>1.0.0</version>
    </dependency>