Blogger Information
Blog 2
fans 0
comment 0
visits 4086
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
apache 代理转发socket.io WebSockets 亲测可用(做记录)
mr的博客
Original
3211 people have browsed it

经过数个小时 的百度终于找到了高人获取到了解决方法

转载于 http://www.it1352.com/213464.html

解决方法 修改 httpd.conf

将以下两行前的注释字符 # 去掉:

#LoadModule proxy_module modules/mod_proxy.so

#LoadModule proxy_http_module modules/mod_proxy_http.so

#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

然后设置要转发的端口(本人新建一个代理主机来转发)

<VirtualHost _default_:2122>
    ServerAdmin XXX@xxx.cn
    ServerName pay.hsza.com:2122
    SSLEngine on
    SSLCertificateFile C:/UPUPW_AP5.5/Apache2/conf/extra/cert/2_pay.hsza.com.crt
    SSLCertificateKeyFile C:/UPUPW_AP5.5/Apache2/conf/extra/cert/3_pay.hsza.com.key
    SSLCertificateChainFile C:/UPUPW_AP5.5/Apache2/conf/extra/cert/1_root_bundle.crt
    ProxyRequests off
    RewriteEngine On
    RewriteCond %{REQUEST_URI}  ^/socket.io            [NC]
    RewriteCond %{QUERY_STRING} transport=websocket    [NC]
    RewriteRule /(.*)           ws://127.0.0.1:2120/$1 [P,L]

    ProxyPass / http://127.0.0.1:2120/
    ProxyPassReverse / http://127.0.0.1:2120/
    #ProxyPassReverse / http://127.0.0.1:2120/
    #ErrorLog "logs/www.xx.cn/error.log"
    #CustomLog "logs/www.xx.cn/access.log" common  
</VirtualHost>

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post