Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivial: Websocket event handler janus is not properly handling the path part in the backend parameter #2603

Closed
JanFellner opened this issue Mar 26, 2021 · 5 comments

Comments

@JanFellner
Copy link
Contributor

JanFellner commented Mar 26, 2021

Humbled over a trivial bug (weekend exercise ;)) where janus seems not to properly handle the url path parameter in the janus.eventhandler.wsevh.jcfg

Path was configured like this:
backend = "ws://10.20.3.220:3000/janus/ws"

But the request is missing the first slash and therefore not properly routed through a straight forward node-express-router implementation.

GET janus/ws HTTP/1.1
Pragma: no-cache
Cache-Control: no-cache
Host: 10.20.3.220
Origin: http://10.20.3.220
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: xvZWqCblY08tyMEfCV2Orw==
Sec-WebSocket-Protocol: janus-event-handlers
Sec-WebSocket-Version: 13

HTTP/1.1 400 Bad Request
Connection: close

I could only solve it with a double slash
backend = "ws://10.20.3.220:3000//janus/ws"

@tmatth
Copy link
Contributor

tmatth commented Mar 26, 2021

@JanFellner sounds like this issue?
warmcat/libwebsockets#414

See their updated usage here:
warmcat/libwebsockets@d2c140c

@lminiero
Copy link
Member

@tmatth thanks for the pointer, so this means we'll have to fix the URI parsing in our code, correct?

@lminiero
Copy link
Member

Should be fixed now.

@JanFellner
Copy link
Contributor Author

Will check thanks... :)

@JanFellner
Copy link
Contributor Author

Works as expected. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants