libwebsockets "User code denied connection"

330 views
Skip to first unread message

Raphael

unread,
May 14, 2022, 1:20:09 PM5/14/22
to meetecho-janus
Hello, i try to connect android to janus using websocket, i tried with ws and wss, i get the same warning in janus log "User code denied connection". I don't understand.
I use this websocket on android : https://github.com/TooTallNate/Java-WebSocket (only onClose get called with code -1, no reason...)
I don't have this problem with the demo (videoroom), i am able to use it with ws and wss.

By the way I use janus as a service, i do "systemctl status janus" but it gives me just few lines, how could I get all ?
Should I recompile libwebsockets with debugging enabled ? I don't know how to do that, I never updated/recompiled janus, i am able to do fresh install but that's it currently...

kaiduan xie

unread,
May 14, 2022, 1:47:52 PM5/14/22
to Raphael, meetecho-janus
Did you add Sec-WebSocket-Protocol: jans-protocol header when client connects to Jansu server? You need something below,

  Draft_6455 draft = new Draft_6455(Collections.<IExtension>emptyList(),

        Collections.<IProtocol>singletonList(new Protocol("janus-protocol")));


  new WebSocketClient(new URI("ws://127.0.0.1:8188"), draft)



/Kaiduan


--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/205b0647-5dc9-42f6-9d12-be1e9ca2ae0en%40googlegroups.com.


--
Founder of Goodstartsoft

kaiduan xie

unread,
May 14, 2022, 1:54:06 PM5/14/22
to Raphael, meetecho-janus
Open Chrome developer tool, and look at the network tab, you can find out the message as attached.
Screen Shot 2022-05-14 at 1.50.42 PM.png

Raphael

unread,
May 14, 2022, 2:32:12 PM5/14/22
to meetecho-janus
I am going to try that, i will send a message here about the result, i thank you so much

Raphael

unread,
May 14, 2022, 3:17:48 PM5/14/22
to meetecho-janus
It worked, thank you so much !
Reply all
Reply to author
Forward
0 new messages