Http proxy works fine with curl but browser says ERR_EMPTY_RESPONSE

Hi everyone.
I have added a http front end for my existing proxy system ( i also have a socks5 front end using the same connection multiplexing logic)
When I use curl both regular http endpoints and https ones through CONNECT verb works just fine, however, when I try to use it in browser I get ERR_EMPTY_RESPONSE while socks version working just fine.

I could not find the exact specs of http proxy (seems its somewhere inside of http spec itself). What I am doing is simply if the verb is something other than connect sending the entire thing to the remote server and returning response to the client.
if it is connect then I return a 200 response to the client then start proxyying actual user-encrypted payload.

Is there any additional step that browser requires and i am missing ? Any ideas?

Yes. What browser do you use? Because I cheat on my internet. (I bypass my phone tethering. Have an ssh proxy on my phone so I can use as much data as I want, without the tethering charges) because of that I know that I have to make sure my firefox is set to use the proxy.

On firefox I had to go to "File::Settings" and searched for proxy. This is after I set the system proxy and other system things used it fine. Such as "chrome" On firefox there is a switch to "Auto-detect" and of course that did not work and just went to "Use system proxy"
And of course it depends on what OS and browser you use. You did not give us that info.

I tried on firefox chrome and brave and tried through foxy proxy and omega proxy.
through those socks5 works just fine btw

I think it may be a mistake on your proxy server, and you must deal with this problem. I am not an expert in proxy servers and use them only to collect analytical data for my company, but what you described seems strange to me. When I buy proxies for price tracking, I usually check the connection in the browser settings, but if you have any problems with this, then either your proxy error or you just need to update your browser and clear the cache.

it appears the problem was with chrome and likes of chrome. unfortunately those browser does not support any form of proxy authentication therefore proxy wouldnt work