purescript-node/purescript-node-http

add support for the `upgrade` event

VFabricio opened this issue · 1 comments

Hi! I am toying with the idea of writing a web socket server in Purescript. That would require access to the upgrade events emitted by Node's HTTP servers. It seems like this is not currently supported, right?

I think something like onUpgrade :: Server -> (Request -> Socket -> Buffer -> Effect Unit) -> Effect Unit would do the trick.

I understand this a niche use case and that client code could go down to the FFI and wrap this itself. But, since this is part of Node's public API, maybe it would make sense to expose this functionality here.

If this sounds like something that this library would want to support, I'd be happy to submit a PR.

We’re open to anything that’s part of the public API, so long as it’s supported by the oldest supported Node version (10, I believe). Things missing from this library are often due to lack of time rather than an intentional omission. Thanks!