Author |
|
werto87
Joined: 01 Aug 2021 Posts: 2 Location: Germany
|
Posted: Mon 02 Aug '21 8:32 Post subject: Can not set ProxyWebsocketIdelTimeout |
|
|
Hi,
I want to set ProxyWebsocketIdelTimeout.
When I set ProxyWebsocketIdelTimeout and run apachectl configtest I get
Quote: | AH00526: Syntax error on line 78 of /etc/httpd/conf/httpd.conf:
Invalid command 'ProxyWebsocketIdleTimeout', perhaps misspelled or defined by a module not included in the server configuration
|
But when I remove ProxyWebsocketIdleTimeout and run httpd -M | grep wstunnel I get
Quote: | proxy_wstunnel_module (shared) |
a2enmod mod_proxy_wstunnel
Quote: | ERROR: Module mod_proxy_wstunnel does not exist! |
ls /etc/httpd/modules | grep wstunnel
Quote: | mod_proxy_wstunnel.so |
httpd -v
Quote: | Server version: Apache/2.4.48 (Unix) Server built: May 28 2021 16:40:47 |
uname -r
How can I set ProxyWebsocketIdelTimeout? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 02 Aug '21 13:34 Post subject: |
|
|
The e2en is
Code: |
sudo a2enmod proxy_wstunnel
|
So your proxy_wstunnel_module with httpd -M is displayed correctly.
But you should be able to do that seeting in the ProxyPass config, too.
For example:
Code: |
ProxyPass /somepath ws://127.0.0.1:6080/ retry=60 keepalive=On timeout=9999 ttl=9999
ProxyPassReverse /somepath ws://127.0.0.1:6080/ retry=60
|
See also ohttps://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass
Scroll down to Worker|BalancerMember parameters.
If you still have a question please ask again. |
|
Back to top |
|
werto87
Joined: 01 Aug 2021 Posts: 2 Location: Germany
|
Posted: Mon 02 Aug '21 16:27 Post subject: |
|
|
Quote: | sudo a2enmod proxy_wstunnel |
Does not work I get the not found error.
I tried it with
My connection still gets canceled after 60 seconds. |
|
Back to top |
|
chamroeun
Joined: 02 Nov 2021 Posts: 2 Location: cambodia
|
Posted: Tue 02 Nov '21 15:02 Post subject: |
|
|
After upgrading to apache 2.4.5, still this option is not available |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 348 Location: UK
|
Posted: Wed 03 Nov '21 18:45 Post subject: |
|
|
@chamroeun - assume you mean Apache 2.4.51, and not 2.4.5.
Checking the documentation (and 2.4.51 code) for mod_proxy_wstunnel https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html, it seems the
ProxyWebsocketIdleTimeout directive has been dropped.
This is on the basis that mod_proxy_wstunnel by default now defers to mod_proxy_http to handle WebSocket connections (see the ProxyWebsocketFallbackToProxyHttp directive). So you'd need separate ProxyPass location sections and parameters to stand any chance of changing the timeout for WebSocket connections.
However, if you change this default, you can force mod_proxy_wstunnel to handle WebSocket connections, viz:
Code: | ProxyWebsocketFallbackToProxyHttp Off |
Although I've not tried it, looking at the mod_proxy_wstunnel code it says:
Code: | /* This handler should take care of the entire connection; make it so that
* nothing else is attempted on the connection after returning. */
c->keepalive = AP_CONN_CLOSE;
do { /* Loop until done (one side closes the connection, or an error) */
... |
so that should hopefully get round your WebSocket timeout issue.
I presume your configuration contains appropriate mod_rewrite directives to handle the upgrade header, e.g.
Code: | RewriteEngine on
RewriteCond ${HTTP:Upgrade} websocket [NC]
RewriteCond ${HTTP:Connection} upgrade [NC]
RewriteRule .* "wss:/localhost:my_wss_port/$1" [P,L] |
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|