jicofo
jicofo copied to clipboard
Cross domain problem
I need to use jitsi in my webapp, and the webapp was served on different server, if I call jitsi from the webapp, the http-bind return cross domain problem.
in real world, the Jicofo and client may served on multiple servers, Can we set the jicofo to support CORS as default? or anyone can tell me how to set the jicofo support cross domain?
This is not jicofo, this is jitsi-videobridge that is serving jitsi-meet web app using jetty.
There is no option currently to change cross-origin. In order to add it you need to modify where the bosh servlet is initialized: https://github.com/jitsi/jitsi-videobridge/blob/c6acc4aea85c7984ab713ad19d54bc0fc8ac0aa4/src/main/java/org/jitsi/videobridge/rest/PublicRESTBundleActivator.java#L220 Something like the solution described here: https://stackoverflow.com/questions/29969996/set-access-control-allow-origin-in-jetty And of course, it needs adding the maven artifact containing CrossOriginFilter: <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlets</artifactId>
This is a jitsi-videobridge issue. But what are you trying to achieve, having jvb and jicofo on different machines? Having multiple bridges? I suppose, there are different solutions for your problem that can be implemented without changing the code for any of the components.
Thanks so much, We want to add video conference in webapp with jitsi, in my first demo, the jvb and jicofo are in same server, but the webapp served on other machine, so i need jitsi support CORS.
I will check the jvb document, thank you @damencho .
Thanks so much, We want to add video conference in webapp with jitsi, in my first demo, the jvb and jicofo are in same server, but the webapp served on other machine, so i need jitsi support CORS.
I don't think there's any need for CORS in any of the jitsi components. The web-app only communicates (via http) with prosody, and we use a proxy for "/http-bind" instead.
@bgrozev when i request /http-bind directly, Jetty response with Access Control Allow Origin error.
@bgrozev And after i config nginx with this guide, Nginx response with BOSH-Connection failed: host-unknown
.
Look at the request in the "network" tab.
@bgrozev
http-bind is proxied, but Jetty strips all of the headers from Prosody, so even configuring Prosody itself to produce the relevant CORS headers doesn't help.
In the past via the NGINX strategy it was possible to allow a remote origin to connect via BOSH to the videobridge endpoints.
@damencho,
I've tried building a new jitsi-videobridge with a CrossOriginFilter adding those headers in, but the bridge just hangs the moment that filter is added to the servletContextHandler.
Does anyone have a reasonable workaround here?
I think perhaps at the moment it seems like disabling the HTTP service and jetty, and just serving the videobridge itself via port 443 is the most reasonable solution, but it would be great to work through jetty itself.
I've tried building a new jitsi-videobridge with a CrossOriginFilter adding those headers in, but the bridge just hangs the moment that filter is added to the servletContextHandler.
Did you use this patch? https://github.com/jitsi/jitsi-videobridge/pull/675
@bgrozev, That worked great, thankyou!
@raghbendranayak please do not hijack issues and post the same question over and over again. You are not increasing your chances of an answer, but the other way around.
Probably outdated, re-open if necessary