nollup icon indicating copy to clipboard operation
nollup copied to clipboard

"Connection" header overwritten by proxy for WS

Open MilanKladivko opened this issue 2 years ago • 4 comments

Hello,

I've been trying out the proxy feature to allow seamless integration with my backend hosted locally. Sadly, I cannot get WS connections to work. Using latest 0.19.0.

When using the proxy in ".nolluprc", the "Connection" header is rewritten from "upgrade" to "close", and my backend rejects it as a websocket protocol violation. Direct connections do not have this issue.

I am not using HMR or other advanced features, just trying to host the frontend through nollup and not my backend directly...

{
    "contentBase": "./public",
    "proxy": {
        "/": "http://localhost:8100"
    }
}

Is there extra configuration required in ".nolluprc"? Should I look into express-http-proxy options to achieve this?

MilanKladivko avatar Apr 02 '22 11:04 MilanKladivko

Nevermind, I guess it's not supported by the proxy lib. https://github.com/villadora/express-http-proxy/issues/28

Feel free to close this, I'll just hack it into the frontend itself then.

MilanKladivko avatar Apr 02 '22 11:04 MilanKladivko

This seems like a reasonable thing that should be supported. I'll have a look into it. :)

PepsRyuu avatar Apr 02 '22 13:04 PepsRyuu

Hey, is there any update on this? I would love to use websockets with this module.

PaulRill00 avatar Jul 22 '22 20:07 PaulRill00

No update on it. Been a very busy few months life-wise! 😅 Probably would have to replace express-http-proxy with something else or somehow manually take care of it. If anyone has additional information on this or suggestions for other proxies to use, happy to consider.

PepsRyuu avatar Jul 22 '22 21:07 PepsRyuu