koa-proxies icon indicating copy to clipboard operation
koa-proxies copied to clipboard

support websocket

Open vagusX opened this issue 7 years ago • 2 comments

vagusX avatar Dec 21 '16 04:12 vagusX

Is this live already? How can we use websocket support?

kreativ-software avatar Nov 14 '17 10:11 kreativ-software

As a workaround.

https://github.com/raphaelsoul/koa-proxies/blob/master/index.js#L84

add this line in source and use it like following:

const server = app.listen();
server.on("upgrade", (req, res) => {
    require("koa-proxies").proxy.ws(req, res, { changeOrigin: true, target: "wss://foo.com", }, function(e) {
        getLogger().error(e);
    });
});

Is this live already? How can we use websocket support?

raphaelsoul avatar Oct 28 '19 03:10 raphaelsoul