Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
Apache does not send the body of the web socket

I want to use Apache to reverse proxy my websocket server.

The socket web server works properly without Apache and has no problems. But when using Apache as websocket reverse proxy , no message delivers to user even tough the Web socket handshake is done properly.

When the connection is closed, all messages are suddenly transmitted to the user.

as you can see handshake with socket server is done properly but no welcome message is send to the client(when using apache reverse proxy)

enter image description here

closing socket server (like ctrl+c) will cause all the stuck data arrive at once

enter image description here

In my experiment, if a large amount of text is echoed at the beginning of the connection(in socket server as welcome message), after passing a certain volume (maybe for($i<200) times echoing welcome message instead of one time), all the text is transferred to the user. Apache seems to be buffering the body of the web socket and flashing it after the buffer is full

enter image description here

my apache directive for reverse proxy :

RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) ws://127.0.0.1:6001/$1 [P,L]

Web socket server : laravel websocket
Php version : 8
Os : centos 7 - managed by whm

update : installed nginx and tried the same everything and it works. I think there is a very high probability that this problem is from Apache or its modules.

any idea of what is going on ?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!