HTPPS and HTTP issue #1977
Replies: 7 comments 8 replies
-
This isn't really a concern of Flask-SocketIO. If you host your app on HTTPS and use https:// URLs to connect to Socket.IO everything should work the same as in your local environment. This error occurs because your front end is using a http:// URL to connect to the Socket.IO server. |
Beta Was this translation helpful? Give feedback.
-
Oh thanks! That never came to my mind! Thanks again!
…On Sat, 22 Apr 2023 at 15:12, Miguel Grinberg ***@***.***> wrote:
This isn't really a concert of Flask-SocketIO. If you host your app on
HTTPS and use https:// URLs to connect to Socket.IO everything should
work the same as in your local environment. This error occurs because your
front end is using a http:// URL to connect to the Socket.IO server.
—
Reply to this email directly, view it on GitHub
<#1977 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVKC2Y2UUK5ZXOBGWJR6TLDXCORZ7ANCNFSM6AAAAAAXHS5FF4>
.
You are receiving this because you authored the thread.Message ID:
<miguelgrinberg/Flask-SocketIO/repo-discussions/1977/comments/5692543@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
What about
`Socket connection to 'wss://../
socket.io/?EIO=4&transport=websocket&sid=CQTIKIcJrqgzaCUpAAAA' failed:
WebSocket is closed before the connection is established`.?
On Sat, 22 Apr 2023 at 15:28, Prateek Pathak ***@***.***>
wrote:
… Oh thanks! That never came to my mind! Thanks again!
On Sat, 22 Apr 2023 at 15:12, Miguel Grinberg ***@***.***>
wrote:
> This isn't really a concert of Flask-SocketIO. If you host your app on
> HTTPS and use https:// URLs to connect to Socket.IO everything should
> work the same as in your local environment. This error occurs because your
> front end is using a http:// URL to connect to the Socket.IO server.
>
> —
> Reply to this email directly, view it on GitHub
> <#1977 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AVKC2Y2UUK5ZXOBGWJR6TLDXCORZ7ANCNFSM6AAAAAAXHS5FF4>
> .
> You are receiving this because you authored the thread.Message ID:
> <miguelgrinberg/Flask-SocketIO/repo-discussions/1977/comments/5692543@
> github.com>
>
|
Beta Was this translation helpful? Give feedback.
-
Any difference between prod and dev which might cause this? Because it works locally. |
Beta Was this translation helpful? Give feedback.
-
What is meant by invalid session? I read https://stackoverflow.com/questions/74596602/flask-socket-invalid-session-lwmxdnrmai59brflaaaa-further-occurrences-of-this. but I'm not using any websocket like gunicorn or eventlet. It's a prod problem I think. Can it possibly be related to the versions? |
Beta Was this translation helpful? Give feedback.
-
Im getting invalid session |
Beta Was this translation helpful? Give feedback.
-
Update: My hosting provider says: However, for a websocket to work you'd usually need a dedicated port for inbound connections. or something like a proxy-pass configuration. Although, such setup cannot be performed on a Shared Hosting server. I would recommend running either a third-party web-socket server, or consider upgrading to our private server solutions and configuring your application with a proxypass configuration. What kind of a third-party web-socket server? |
Beta Was this translation helpful? Give feedback.
-
Mixed Content: The page at 'https://.../chat' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://.../socket.io/?EIO=4&transport=polling&t=OUdK2XB'. This request has been blocked; the content must be served over HTTPS. c
When I worked locally, my chat app worked perfectly, but I pushed the changes to my site, which is https, it gave the error. I'm not very qualified with networking and sockets and such , so help would be greatly appreciated as soon as possible. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions