fastify/fastify-websocket

Delay openning connection

punkpeye opened this issue · 2 comments

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

I have a use case that requires to delay initializing socket connection until some async checks are complete, i.e. client should not receive open event until then.

Is it possible to do this using fastify-websocket or do I need to go a layer down to using ws?

I think you can use a onRequest or preHandler hook.

duh! I think it would work indeed. Will give this a shot. Thank you