Socket
WebSocket Connection Details
The 159.65.159.79:8082 Socket API allows for real-time communication using WebSocket technology. Below are the details and implementation methods for connecting to the socket.
Connection Details
- Base URL:
wss://159.65.159.79:8082/api/socket - Authentication: Requires a valid session cookie (
JSESSION) for receiving relevant responses.
Implementation Methods
There are two ways to authenticate and use the socket:
1. Basic Authentication
- Use your credentials to authenticate via Basic Auth.
- After successful authentication, a session cookie (
JSESSION) will be generated. - Use this cookie to establish the WebSocket connection.
2. Cookie-Based Authentication
- If you already have a valid session cookie (
JSESSION), you can directly use it to connect to the WebSocket. - Ensure the cookie is included in the request headers for the WebSocket handshake.
Example Workflow
-
Generate Cookie Using Basic Auth:
-
Send a request to the authentication endpoint with your credentials.
-
Extract the
JSESSIONcookie from the response. -
Establish WebSocket Connection:
-
Use the
JSESSIONcookie in the WebSocket handshake request. - Connect to the WebSocket endpoint:
wss://159.65.159.79:8082/api/socket.
By following this approach, you can seamlessly integrate with the 159.65.159.79:8082 Socket API for real-time communication.