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
Connect via HTTP to a WS Endpoint? #1123
Comments
There is no such virtual host configured in prosody. Please use the community forum when you have questions or problems before opening new issues. |
Sorry for be unpresize. But the core of my question leave unanserwed. Yes I can try to use the forum next time. |
The code you are showing is something that is running on meet.jit.si at the moment using websockets, you can try debugging it and see how it works. I pointed you the reason for the error you see, I think the problem is webserver config using localhost as host when proxing the request |
Thanks for your answer. I created a Forumentry 45407 I'm sure I can also figure this out for apache, but my origin question is why. Why a websocket needs a HTTP GET Request? Websocket should be open for a long time. Especially if there are messages, and there are a lot of messages. If your are using BOSH it may make sense, but not for WebSocket from my Point of view. The linked sourcecode shows how the url will be transformed from wss:// to https:// but this a different protocoll. (Yes I know websocket based on http) Currently I solved the problem setting websocketKeepAlive to 0, so the LibJitsi will not try to make keepAlive for websocket. |
I came across the same problem. Because it is trying to connect to an ws endpoint via http, the response is not correct which results in a lot of errors. I don't understand why sending new http request should affect a keep-alive for another connection with even another protocol. Access to fetch at 'https://my.domain/xmpp-websocket?token=mytoken' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
GET https://my.domain/xmpp-websocket?token=mytoken net::ERR_FAILED
[modules/xmpp/XmppConnection.js] Websocket Keep alive failed for url: https://my.domain/xmpp-websocket?token=mytoken {error: TypeError: Failed to fetch} This is set to cross_domain_websocket = true @damencho Does it not make more sense to send ping/pong messages via the websocket connection and enable auto reconnect. |
Not sure I understand (damencho is out for the week). Who is starting the bogus connection? |
You know that I built this mattermost plugin. So the mattermost servers which are using this plugin are not under my domain but are communicating with my jitsi instance. After switching to websockets I have the problem that the the websocket connection works fine but all the keep-alive requests are failing because of CORS. I'm still wondering why lib-jitsi-meet is sending HTTP GET requests to keep a websocket connection alive. This seems to be the root cause. I'm not using nginx as a proxy but I don't think that this is causing any issues.
|
Ah I see. IIRC that was done as a keep-alive mechanism, so load balancers would keep the room association open. We should probably change that to HEAD, but not sure that'd break things. |
Having the same problem but the flags are already set in prosody (v0.11.7 which is running behind nginx reverse-proxy) configuration: cross_domain_bosh = true;
cross_domain_websocket = true;
consider_bosh_secure = true;
consider_websocket_secure = true; So there is a CORS problem and:
with the error: |
@renepardon did you find any solution for this? I having same problem with docker-jitsi-meet setup and this is the only issue I found about this. |
|
Hello,
does it make sense to connect to a WebSocked Enpoint via HTTP GET Request? What exactly should this do?
I use websocket instead of BOSH to connect from Jitsi Web Page too prosody XMPP Server.
The only thing I get is an error 500 on Apache and in the logfile:
SourceCode: XmppConnection.js#L328
ApacheLogfile with Error 500
My Apache conf for this URL
And on Chrome Console:
Curl Prosody also dont like this request:
The text was updated successfully, but these errors were encountered: