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

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.



Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: ProxyPass issues
Author
edwardsmarkf



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

PostPosted: Tue 03 Mar '20 19:10    Post subject: ProxyPass issues Reply with quote

hello -

i have having a very difficult time to get apache ProxyPass working properly with socket.io - and when i say "properly", everything appears to be working as far as the application is concerned, but the apache log file is filling up with error messages that look like this:
Quote:
[Mon Mar 02 18:25:03.199849 2020] [proxy:error] [pid 28494] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:20005 (localhost) failed
[Mon Mar 02 18:25:03.199892 2020] [proxy:error] [pid 28494] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 5s
[Mon Mar 02 18:25:03.199898 2020] [proxy_http:error] [pid 28494] [client 71.223.254.40:50269] AH01114: HTTP: failed to make connection to backend: localhost, referer: https://example.com/proxyPort20005/

and my chrome browser console has messages that look like this:
Quote:
VM92:1 POST https://example.com/proxyPort20005/socket.io/?EIO=3&transport=polling&t=N2TRgw1&sid=BjXXB 400 (Bad Request)
VM92:1 GET https://example.com/proxyPort20005/socket.io/?EIO=3&transport=polling&t=N2TRgw1&sid=BjXXB 400 (Bad Request)

i have tried every combination of ways i can research, such as:
Code:
 RewriteCond ${HTTP:Upgrade} websocket [NC]
 RewriteCond ${HTTP:Connection} upgrade [NC]
 RewriteRule .* "ws://localhost:20005/$1" [P,L]

 <Location /proxyPort20005/>
        ProxyPass               http://localhost:20005/  retry=5  timeout=600  Keepalive=On
        ProxyPassReverse        http://localhost:20005/
 </Location>

and also this attempt from https://serverfault.com/questions/290121/configuring-apache2-to-proxy-websocket
Code:
 RewriteCond     /proxyPort20005/                [C]
 RewriteCond %{QUERY_STRING} transport=polling       [NC]
 RewriteRule /(.*)           http://0.0.0.0:20005/$1 [P,L]
 <Location /proxyPort20005/socket.io/socket.io.js>
       # Explicitly send the request for the client-script to HTTP:
     ProxyPass               http://localhost:20005/socket.io/socket.io.js
     ProxyPassReverse        http://localhost:20005/socket.io/socket.io.js
 </Location>
 <Location /proxyPort20005/socket.io/>
       # Anything else goes to the WebSocket protocol:
     ProxyPass               http://localhost:20005/socket.io/
     ProxyPassReverse        http://localhost:20005/socket.io/
 </Location>
 <Location /proxyPort20005/>
      # Any additional stuff (the actual site) comes here
     ProxyPass               http://localhost:20005/
     ProxyPassReverse        http://localhost:20005/
 </Location>

the other forums have suggested i move to Nginx or try HAproxy, but it seems like I should be able to get this one resolved easily using apache. i also have my question posted at https://stackoverflow.com/questions/60498087/issues-running-socket-io-over-an-apache-proxy

does anybody have any other suggestions for me?
Back to top
Cromwell



Joined: 27 Feb 2020
Posts: 1
Location: UK, Near Maidstone

PostPosted: Thu 05 Mar '20 1:34    Post subject: Re: ProxyPass issues Reply with quote

Have you seen the article from https://www.serverlab.ca/tutorials/linux/web-servers-linux/
By Shane Rainville Titled 'How to Reverse Proxy Websockets with Apache 2.4'

I realise the article is for Linux but it is 2.4 and may just work for Windows ?
Back to top


Reply to topic   Topic: ProxyPass issues View previous topic :: View next topic
Post new topic   Forum Index -> Apache