Websockets on Apache over SSL layers

1 post / 0 new
#1 Sat, 01/19/2019 - 14:55
edwardsmarkf

Websockets on Apache over SSL layers

i was able to piece together a working solution to using WebSockets over ssl layers by looking at this example and doing this:

.htaccess:

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

httpd.conf:
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>

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>

however, the apacheLounge forum suggested this instead:

ProtocolsHonorOrder On
Protocols h2c h2 http/1.1
H2Direct On

i am not sure how to do this. i did find this forum with a bit more information.

hopefully, i can install just using yum, or perhaps rpm. this instruction page:

https://centos.pkgs.org/7/epel-x86_64/libnghttp2-1.31.1-1.el7.x86_64.rpm...

seemed promising but the last rpm line # rpm -Uvh epel-release*rpm; gives me:

error: File not found by glob: epel-release*rpm

any suggestions on how to implement this on Centos 7? or is my original script adequate.

EDIT: i learned that ProtocolsHonorOrder is only available in Apache/2.4.17. are my changes to [dot]httpd the best option? it does seem to be working fine.