graphql-ws icon indicating copy to clipboard operation
graphql-ws copied to clipboard

Exposing clients and IP address

Open mattkrick opened this issue 7 months ago • 2 comments

Story

  • As a uWS server, I want to capture the IP address of the connected user for logging. This could be accomplished by e.g. if the return value of behavior.upgrade could get injected into the UpgradeData.

  • As a developer, when I deploy a new version of my server I send a SIGTERM to the old servers. At that time, I would like to gracefully tell each connected client to disconnect over the course of the next 30 seconds so they automatically reconnect to a new server. This requires iterating over a list of all connected clients. Exposing that Map on the return value of makeBehavior would allow me to do that without creating a duplicate object. Alternatively, makeBehavior could accept a clients Map in the options.

mattkrick avatar Mar 26 '25 23:03 mattkrick