logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


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: Can not set ProxyWebsocketIdelTimeout
Author
werto87



Joined: 01 Aug 2021
Posts: 2
Location: Germany

PostPosted: Mon 02 Aug '21 8:32    Post subject: Can not set ProxyWebsocketIdelTimeout Reply with quote

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
Quote:
5.13.5-arch1-1

How can I set ProxyWebsocketIdelTimeout?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Mon 02 Aug '21 13:34    Post subject: Reply with quote

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

PostPosted: Mon 02 Aug '21 16:27    Post subject: Reply with quote

Quote:
sudo a2enmod proxy_wstunnel

Does not work I get the not found error.
I tried it with
Quote:
ProxyPass /wss/ wss://my-domain.com:my_port retry=120 keepalive=On timeout=9999 ttl=9999
ProxyPassReverse /wss/ wss://my-domain.com:my_port retry=120

My connection still gets canceled after 60 seconds.
Back to top
chamroeun



Joined: 02 Nov 2021
Posts: 2
Location: cambodia

PostPosted: Tue 02 Nov '21 15:02    Post subject: Reply with quote

After upgrading to apache 2.4.5, still this option is not available
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 305
Location: UK

PostPosted: Wed 03 Nov '21 18:45    Post subject: Reply with quote

@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: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 04 Nov '21 0:08    Post subject: Reply with quote

Dropped? If I remember correctly that is only available in trunk.

See https://github.com/apache/httpd/commit/4b5394837f82c9c3bb8bdd1191520b6cb55debd6#diff-6e833b90e7c1c4aee226e000b933193de42e16c79ceb3bafa85bb1324fc5545a
Back to top


Reply to topic   Topic: Can not set ProxyWebsocketIdelTimeout View previous topic :: View next topic
Post new topic   Forum Index -> Apache