Closed
Description
My Socket url is of form "wss://socket-..."
and inside that I want to subscribe to the channel of form "myChannel.website.com"
I am using this code to connect to the channel but it gives java.net.MalformedURLException: unknown protocol: wss
error.
try {
socket = IO.socket(SERVER_URL + cobaltStore.getToken());
socket.connect();
Log.d(TAG, "testSocket: connected? "+socket.connected());
socket.on(channel, args -> {
for (Object arg : args) {
Log.d(TAG, "testSocket: call: " + arg);
}
});
} catch (Exception e) {
e.printStackTrace();
Log.d(TAG, "testSocket: "+e.getLocalizedMessage());
}
Please let me know what I am doing wrong and guide me to the correct way to connect to the socket and channel.
Metadata
Metadata
Assignees
Labels
No labels