is-websocket-handshake
Check if a request is a WebSocket handshake request.
Example WebSocket handshake:
GET /chat HTTP/1.1Host: example.com:8000Upgrade: websocketConnection: Upgrade
Installation
npm install is-websocket-handshake --save
Usage
var http = var isWebSocketHandshake = var server = http server http
API
isWebSocketHandshake(request)
Accepts an instance of a http.IncomingMessage
object
as the first argument.
Returns a boolean.
Acknowledgements
This project was kindly sponsored by Opbeat.
License
MIT