Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9042219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:25:55+00:00 2026-06-16T10:25:55+00:00

I am trying to connect browsers with a server that provides Server Sent Events

  • 0

I am trying to connect browsers with a server that provides Server Sent Events (SSE). This server has a different domain than the original one. For example if you call http://d1.example.com/page this page will try to connect to an SSE channel on http://d2.example.com/subscribe. Trying to do that will prompt the following error:

Uncaught Error: SECURITY_ERR: DOM Exception 18

on the line:

var source = new EventSource("http://d2.example.com/subscribe")

How can I fix that?

Update (Solutions that I have tried out):

1- CORS

I tried CORS by adding Access-Control-Allow-Origin:* to the headers of my web service d2.example.com. It did not solve EventSource problem, even though $.get("http://d2.example.com") calls from d1.example.com pages are working fine now! I thought SSE works on normal HTTP requests, so why is it not working on Chrome?

2- Redirect

I am using httpd server, so I created a redirect rule in d1.example.com virtual host that passes SSE requests to d2.example.com. It worked perfectly with Firefox. Chrome on the other hand did not prompt any error and did not connect to the SSE server either. It looks like it dumped the whole EventSource command. It looks like this solution will never work, so lets move on…

3- Reverse proxy

Both browsers connected on d1.example.com/subscribe which is basically connecting to d2.example.com through reverse proxy. But on_close event is never caught, even if the browser is closed. Which makes sense since the d2 server is now making the channel with the proxy server. How can I forward the on_close event from proxy server to d2?

Is there any different ways that could make this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T10:25:57+00:00Added an answer on June 16, 2026 at 10:25 am

    The odds are high this is an issue of cross-origin resource sharing, which you must enable on the relevant domains.

    http://enable-cors.org/

    As the MDN says:

    Note: Although it’s not yet part of the standard, EventSource supports CORS in Firefox 11 and later. This is expected to become standard soon.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using HttpClient 4.1.0, we're trying to connect to a remote server that normally would
This error occurs when I was trying to connect to SQL Server 2005 which
I'm trying to make a simple C# web server that, at this stage, you
When I am trying to connect to my SVN repository on some remote server
I am trying to connect to a MySQL Server using JDBC tool in java
I am trying to connect the JSF to database. This are the files web.xml
I have this code that works fine on my local server but doesn't work
I'm trying to use Facebook connect in an IFrame. It seems that after the
I'm trying to connect a client side application (written in c++, although that shouldn't
I am trying to connect to the database but I am getting this exception:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.