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

it could not connect for sse #221

Open
bayueqiankong opened this issue Sep 1, 2023 · 3 comments
Open

it could not connect for sse #221

bayueqiankong opened this issue Sep 1, 2023 · 3 comments

Comments

@bayueqiankong
Copy link

bayueqiankong commented Sep 1, 2023

In my vue3 project , I use vite to configure proxy cross-domain and change origin.
example: // localhost:3000/dev-api/users/me → http://vapi.youlai.tech/users/me

It is failed to use EventSourcePolyfill or EventSource for sse connection.
I am sure that server is working and server sent connection respond to internet .But browser could not receive the respond so that is waiting for connection , and google browser's status is pending.
I try to set withCredentials: true,but nothing change.How do I deal this question? Maybe question is existing browser.
图片
new EventSource(url, { withCredentials: false });
or
new EventSourcePolyfill(url, { withCredentials: false });
url is /***/***/subcribe

@bayueqiankong
Copy link
Author

bayueqiankong commented Sep 1, 2023

Another , how to set origin? Origin item is empty in resquest header.
How to cross-domain ?
图片

@Shubhra1028
Copy link

Hello Everyone, I'm facing the same issue of origin not being sent which results in CORS and I have no clue what is causing it. It works for most of the users, but there are cases where the origin is not being sent by the browser.

Any update or fix on this issue would be great.

:)

@Yaffle
Copy link
Owner

Yaffle commented Sep 21, 2023

@bayueqiankong , @Shubhra1028 browser appends Origin header for CORS requests, for same-origin it does not.

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