logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



solution to: Error during WebSocket handshake: Unexpected ?

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
edwardsmarkf



Joined: 20 Feb 2013
Posts: 16
Location: cottonwood, az

PostPosted: Thu 17 Jan '19 19:23    Post subject: solution to: Error during WebSocket handshake: Unexpected ? Reply with quote

hello -

i found many excellent replies to this issue:

websocket connection to .... failed: Error during WebSocket handshake: Unexpected response code: 400"
however, none of the solutions seemed to talk about ssl websites. according to a reply on StackOverflow:

https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon/48096141

i was able to piece this together:

Quote:
.htaccess:

RewriteRule ^newPage/ https://mydomain.com:8010/[P,QSA,L]

RewriteRule ^socket.io/https://mydommain.com:8010/socket.io/ [P,QSA,L]

httpd.conf:

# 2019-01-15

LoadModule proxy_module /usr/lib64/httpd//modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib64/httpd//modules/mod_proxy_http.so
LoadModule headers_module /usr/lib64/httpd//modules/mod_headers.so
LoadModule deflate_module /usr/lib64/httpd//modules/mod_deflate.so

ProxyVia On

ProxyRequests Off

ProxyPreserveHost on

<Location /socket.io>

## https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon/48096141

RewriteEngine On

RewriteCond %{QUERY_STRING} transport=websocket [NC]

RewriteRule /(.*) wss://mydomain.com:8010/socket.io/$1[P,L]

ProxyPass https://mydomain.com:8010/socket.io retry=0 timeout=30
ProxyPassReverse https://mydomain.com:8010/socket.io
</Location>


so all I did was to take the StackOverflow answer and change apache module file locations, http:// to https://, etc. the problem seems to be solved, or so it appears.

any suggestions or improvements on this approach?
Back to top
edwardsmarkf



Joined: 20 Feb 2013
Posts: 16
Location: cottonwood, az

PostPosted: Fri 18 Jan '19 18:38    Post subject: Reply with quote

more information here:


https://www.reddit.com/r/openode/comments/agq4eq/websocket_connection_to_failed_error_during/

https://www.apachelounge.com/viewtopic.php?p=37735#37735
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1