Socket Connection to node server from https gives mixed content errorSocket.io connection url?Getting Node-http-proxy to work with socket.io?Connecting to Nodejs/Socket.IO server with SSL (https) when listening to custom portConnect to Socket.io server from a Rails serverIssue in connecting Rails client to Node serverConnect to Heroku socket from another server/localhostCannot connect to socket io serverconnect socket.io android client through a reverse proxy server to socket serverCouldn't get any response from the web socket server
Can pay be witheld for hours cleaning up after closing time?
Is using a hyperlink to close a modal a poor design decision?
Which household object drew this pattern?
Sleeping solo in a double sleeping bag
What is the hex versus octal timeline?
LeetCode: Pascal's Triangle C#
What is the appropriate benchmark for a Long/Short VIX futures strategy?
Avoiding racist tropes in fantasy
What is wrong about this application of Kirchhoffs Current Law?
Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?
Accent on í misaligned in bibliography / citation
Why did MS-DOS applications built using Turbo Pascal fail to start with a division by zero error on faster systems?
The remote server returned an error: (401) Unauthorized: While uploading file in document library using App Based Token Authentication
When did G-d say to Yaakov that he will have 12 sons?
In the MCU, why does Mjölnir retain its enchantments after Ragnarok?
Did a flight controller ever answer Flight with a no-go?
Dealing with an extrovert co-worker
How to use "Du hast/ Du hattest'?
Why do all fields in a QFT transform like *irreducible* representations of some group?
I got kicked out from graduate school in the past. How do I include this on my CV?
How would one country purchase another?
What professions would a medieval village with a population of 100 need?
What brought these couples together?
Fancy String Replace
Socket Connection to node server from https gives mixed content error
Socket.io connection url?Getting Node-http-proxy to work with socket.io?Connecting to Nodejs/Socket.IO server with SSL (https) when listening to custom portConnect to Socket.io server from a Rails serverIssue in connecting Rails client to Node serverConnect to Heroku socket from another server/localhostCannot connect to socket io serverconnect socket.io android client through a reverse proxy server to socket serverCouldn't get any response from the web socket server
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a website running on https and as part of new feature I created a nodejs+socket.io based conversation server.
I decided to host conversation server on separate AWS instance.
When I try to make socket connection from my main website (running on https) to conversation server (running on AWS static IP instance like http://123.123.45.56) then it does not establish socket connection properly and browser shows following error logged to console:
Mixed Content: The page at 'https://www.mydomain' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://123.123.45.56/socket.io/?payload=asdfkasdla'. This request has been blocked; the content must be served over HTTPS.
This is how I make the connection node server:
io.connect(chatServerURL,query: "payload=" + encryptedPayload,secure: false);
On conversation server I am routing all the traffic coming on port 80 with the route /socket.io to locally node server port and server as follows:
RewriteEngine On
RewriteCond %REQUEST_URI ^/socket.io [NC]
RewriteCond %QUERY_STRING transport=websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
What should I do to make it work?
I don't have domain to use just for chat server and then assign ssl to that domain. I know that should not be the way to make it work.
What is the solution to it?
javascript node.js websocket socket.io reverse-proxy
add a comment |
I have a website running on https and as part of new feature I created a nodejs+socket.io based conversation server.
I decided to host conversation server on separate AWS instance.
When I try to make socket connection from my main website (running on https) to conversation server (running on AWS static IP instance like http://123.123.45.56) then it does not establish socket connection properly and browser shows following error logged to console:
Mixed Content: The page at 'https://www.mydomain' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://123.123.45.56/socket.io/?payload=asdfkasdla'. This request has been blocked; the content must be served over HTTPS.
This is how I make the connection node server:
io.connect(chatServerURL,query: "payload=" + encryptedPayload,secure: false);
On conversation server I am routing all the traffic coming on port 80 with the route /socket.io to locally node server port and server as follows:
RewriteEngine On
RewriteCond %REQUEST_URI ^/socket.io [NC]
RewriteCond %QUERY_STRING transport=websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
What should I do to make it work?
I don't have domain to use just for chat server and then assign ssl to that domain. I know that should not be the way to make it work.
What is the solution to it?
javascript node.js websocket socket.io reverse-proxy
Broadly speaking, the solution is not to make a request to an insecurehttp:orws:websocket service (instead you must connect to anhttps:orwss:service). How you go about making your existing service usehttps:/wss:(or finding a new service that does) depends on the particulars of the service you're connecting to (or your criteria for selecting a new service with the support you need). The other solution is to make your top-level page insecure, and stop serving your current page via HTTPS.
– apsillers
Mar 27 at 17:04
add a comment |
I have a website running on https and as part of new feature I created a nodejs+socket.io based conversation server.
I decided to host conversation server on separate AWS instance.
When I try to make socket connection from my main website (running on https) to conversation server (running on AWS static IP instance like http://123.123.45.56) then it does not establish socket connection properly and browser shows following error logged to console:
Mixed Content: The page at 'https://www.mydomain' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://123.123.45.56/socket.io/?payload=asdfkasdla'. This request has been blocked; the content must be served over HTTPS.
This is how I make the connection node server:
io.connect(chatServerURL,query: "payload=" + encryptedPayload,secure: false);
On conversation server I am routing all the traffic coming on port 80 with the route /socket.io to locally node server port and server as follows:
RewriteEngine On
RewriteCond %REQUEST_URI ^/socket.io [NC]
RewriteCond %QUERY_STRING transport=websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
What should I do to make it work?
I don't have domain to use just for chat server and then assign ssl to that domain. I know that should not be the way to make it work.
What is the solution to it?
javascript node.js websocket socket.io reverse-proxy
I have a website running on https and as part of new feature I created a nodejs+socket.io based conversation server.
I decided to host conversation server on separate AWS instance.
When I try to make socket connection from my main website (running on https) to conversation server (running on AWS static IP instance like http://123.123.45.56) then it does not establish socket connection properly and browser shows following error logged to console:
Mixed Content: The page at 'https://www.mydomain' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://123.123.45.56/socket.io/?payload=asdfkasdla'. This request has been blocked; the content must be served over HTTPS.
This is how I make the connection node server:
io.connect(chatServerURL,query: "payload=" + encryptedPayload,secure: false);
On conversation server I am routing all the traffic coming on port 80 with the route /socket.io to locally node server port and server as follows:
RewriteEngine On
RewriteCond %REQUEST_URI ^/socket.io [NC]
RewriteCond %QUERY_STRING transport=websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
What should I do to make it work?
I don't have domain to use just for chat server and then assign ssl to that domain. I know that should not be the way to make it work.
What is the solution to it?
javascript node.js websocket socket.io reverse-proxy
javascript node.js websocket socket.io reverse-proxy
edited Mar 27 at 16:54
Hammad
asked Mar 27 at 16:48
HammadHammad
1,4282 gold badges13 silver badges30 bronze badges
1,4282 gold badges13 silver badges30 bronze badges
Broadly speaking, the solution is not to make a request to an insecurehttp:orws:websocket service (instead you must connect to anhttps:orwss:service). How you go about making your existing service usehttps:/wss:(or finding a new service that does) depends on the particulars of the service you're connecting to (or your criteria for selecting a new service with the support you need). The other solution is to make your top-level page insecure, and stop serving your current page via HTTPS.
– apsillers
Mar 27 at 17:04
add a comment |
Broadly speaking, the solution is not to make a request to an insecurehttp:orws:websocket service (instead you must connect to anhttps:orwss:service). How you go about making your existing service usehttps:/wss:(or finding a new service that does) depends on the particulars of the service you're connecting to (or your criteria for selecting a new service with the support you need). The other solution is to make your top-level page insecure, and stop serving your current page via HTTPS.
– apsillers
Mar 27 at 17:04
Broadly speaking, the solution is not to make a request to an insecure
http: or ws: websocket service (instead you must connect to an https: or wss: service). How you go about making your existing service use https:/wss: (or finding a new service that does) depends on the particulars of the service you're connecting to (or your criteria for selecting a new service with the support you need). The other solution is to make your top-level page insecure, and stop serving your current page via HTTPS.– apsillers
Mar 27 at 17:04
Broadly speaking, the solution is not to make a request to an insecure
http: or ws: websocket service (instead you must connect to an https: or wss: service). How you go about making your existing service use https:/wss: (or finding a new service that does) depends on the particulars of the service you're connecting to (or your criteria for selecting a new service with the support you need). The other solution is to make your top-level page insecure, and stop serving your current page via HTTPS.– apsillers
Mar 27 at 17:04
add a comment |
1 Answer
1
active
oldest
votes
This might help someone in the future for right approach.
The way to do this is to send socket connection to same server i.e the one on running on https and then use reverse proxy there to proxy socket request to different machine running on http (running the node+socket.io server).
On Apache server I need to enable modules proxy and proxy_http and add these directives in apache virtual host configuration:
ProxyPass /socket.io/ http://123.45.56.67/socket.io
ProxyPassReverse /socket.io/ http://123.45.56.67/socket.io
There are lot resources online for that, I was just unaware of this proxying thing.
That's the way to do it.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382527%2fsocket-connection-to-node-server-from-https-gives-mixed-content-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This might help someone in the future for right approach.
The way to do this is to send socket connection to same server i.e the one on running on https and then use reverse proxy there to proxy socket request to different machine running on http (running the node+socket.io server).
On Apache server I need to enable modules proxy and proxy_http and add these directives in apache virtual host configuration:
ProxyPass /socket.io/ http://123.45.56.67/socket.io
ProxyPassReverse /socket.io/ http://123.45.56.67/socket.io
There are lot resources online for that, I was just unaware of this proxying thing.
That's the way to do it.
add a comment |
This might help someone in the future for right approach.
The way to do this is to send socket connection to same server i.e the one on running on https and then use reverse proxy there to proxy socket request to different machine running on http (running the node+socket.io server).
On Apache server I need to enable modules proxy and proxy_http and add these directives in apache virtual host configuration:
ProxyPass /socket.io/ http://123.45.56.67/socket.io
ProxyPassReverse /socket.io/ http://123.45.56.67/socket.io
There are lot resources online for that, I was just unaware of this proxying thing.
That's the way to do it.
add a comment |
This might help someone in the future for right approach.
The way to do this is to send socket connection to same server i.e the one on running on https and then use reverse proxy there to proxy socket request to different machine running on http (running the node+socket.io server).
On Apache server I need to enable modules proxy and proxy_http and add these directives in apache virtual host configuration:
ProxyPass /socket.io/ http://123.45.56.67/socket.io
ProxyPassReverse /socket.io/ http://123.45.56.67/socket.io
There are lot resources online for that, I was just unaware of this proxying thing.
That's the way to do it.
This might help someone in the future for right approach.
The way to do this is to send socket connection to same server i.e the one on running on https and then use reverse proxy there to proxy socket request to different machine running on http (running the node+socket.io server).
On Apache server I need to enable modules proxy and proxy_http and add these directives in apache virtual host configuration:
ProxyPass /socket.io/ http://123.45.56.67/socket.io
ProxyPassReverse /socket.io/ http://123.45.56.67/socket.io
There are lot resources online for that, I was just unaware of this proxying thing.
That's the way to do it.
answered Mar 28 at 6:14
HammadHammad
1,4282 gold badges13 silver badges30 bronze badges
1,4282 gold badges13 silver badges30 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382527%2fsocket-connection-to-node-server-from-https-gives-mixed-content-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Broadly speaking, the solution is not to make a request to an insecure
http:orws:websocket service (instead you must connect to anhttps:orwss:service). How you go about making your existing service usehttps:/wss:(or finding a new service that does) depends on the particulars of the service you're connecting to (or your criteria for selecting a new service with the support you need). The other solution is to make your top-level page insecure, and stop serving your current page via HTTPS.– apsillers
Mar 27 at 17:04