kerryjiang / SuperSocket

SuperSocket is a light weight, cross platform and extensible socket server application framework.
Apache License 2.0
3.95k stars 1.15k forks source link

WebSocketServer with BasicAuthentification #685

Closed optimry closed 3 months ago

optimry commented 1 year ago

Hi Guys

Using the SuperSocket WebSocketServer is it possible to perform basic authentification on the http request before the upgrade to websocket? If so, any idea to where I should plugin my BasicAuthentificationHandler?

Thanks

kerryjiang commented 10 months ago

You can use HandshakeValidator:

https://github.com/kerryjiang/SuperSocket/blob/07d5a6f86601cbb7c76b2f18503103b3b232aede/test/SuperSocket.Tests/WebSocket/WebSocketBasicTest.cs#L163C103-L163C103