Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

The One2ManyCallApp refuses connections when the HTML client page is served from a different machine #15

Closed

Description

@andrew-koster-

I've set up the unmodified tutorial app on a server, and it works as far as that goes: http://chat-server-rtc.dev.t3ach.co:8080/

But my existing site isn't on that server, it's on a dedicated Apache server that only serves static HTML/Javascript files. I expect that this would be the case with almost all real-world uses of this software (am I wrong?).

I've copied the HTML and Javascript, from the tutorial app, onto a page on the web server: http://dev.t3ach.co/main/conference-room?id=643

Since it's the same Kurento server (or "Java client"), and since the browser client is using the same HTML/Javascript, one would expect things to keep working on this new page. But the socket won't even open, it gives me this error:

WebSocket connection to 'ws://chat-server-rtc.dev.t3ach.co/call' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

I know that browsers don't like cross-domain communication, but this is the server refusing the connection, so I don't think we can blame the browser. There must be some way to modify the server so that it accepts cross-domain socket connections.

The only suggestion that I've found, after extensive searching, is to use the WebSocketHandlerRegistry.setAllowedOrigins method, and this just makes the problem worse (connections get refused even from the same server using the 100% unmodified page), whether I allow all domains or only a specific one.

Isn't this a very common requirement for any kind of specialized server that does something other than displaying static files? Being able to access it from a page hosted on a standard web server? It is in my experience, but I'm really second-guessing myself here, because I'm apparently the first person to have this problem.

If what I'm trying to do is outside of the scope of supported features, I'll have to maintain two separate public-facing web sites that look identical, and they'll need to share user state such as logins. I'll do that if I need to, but it seems like a lot of code duplication and added complexity.

Activity

  1. igracia commented on Nov 17, 2015

    @igracia
    Contributor

    Instead of copying the content of the app, have you tried proxying via Apache? This

    WebSocket connection to 'ws://chat-server-rtc.dev.t3ach.co/call' failed: Error in connection
    establishment: net::ERR_CONNECTION_REFUSED

    clearly indicates that it's trying to connect to a place where the websockets are not listening (note that the port is missing)

    What you are asking is indeed very common, but I think that how to best serve your web-app is something that is not particular to Kurento. I'm setting an invalid flag on this one for that reason.

  2. added
    not-a-bug
    on Nov 17, 2015
  3. igracia commented on Dec 22, 2015

    @igracia
    Contributor

    I'm closing this, as it is not a bug, and there has been no feedback for over a month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    not-a-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions