Kitware / wslink

Python/JavaScript library for communicating over WebSocket
https://kitware.github.io/wslink/
BSD 3-Clause "New" or "Revised" License
83 stars 27 forks source link

Add onConnect on onClose methods to ServerProtocol and LinkProtocol #80

Closed yasushi-saito closed 2 years ago

yasushi-saito commented 2 years ago

onConnect(request, client_id) -> None onClose(client_id) -> None

They are called when a websocket connection is established or closed. Arg request is the aiohttp HTTP request header. client_id is an opaque string that identifies the connection. onC

Our use case is use an HTTP cookie in the request header to authenticate the request.

A clear and concise description of what the problem was and how this pull request solves it.

fix #ISSUE_NUMBER

jourdain commented 2 years ago

Seems reasonable.

jourdain commented 2 years ago

The commit message needs to follow semantic-release. i.e.

feat(connection): forward request+client_id to life cycle methods

... longer description if need be...
jourdain commented 2 years ago

:tada: This PR is included in version 1.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: