fastify / fastify-websocket

basic websocket support for fastify
MIT License
393 stars 72 forks source link

Example of usage with WebSockets? #223

Closed RIP21 closed 1 year ago

RIP21 commented 1 year ago

Hey I would like to use this as a proxy for local development and I'm not sure how to configure this proxy so WebSocket proxying is working.

It's not clear how to do that from README.md

Thanks

climba03003 commented 1 year ago

You choose the wrong package. Please use https://github.com/fastify/fastify-http-proxy for proxy.

RIP21 commented 1 year ago

@climba03003 obviously but there is a whole section in this library that actually mentions this library. https://github.com/fastify/fastify-http-proxy#websocket So I thought there is a good example of how it works.

climba03003 commented 1 year ago

Proxy would be a dedicated usage for each developer. I don't think it is good to provide an example which would not cover all case and the maintain of this example would be a hard job.

You can scan through how to use ws inside @fastify/http-proxy source code.