@wormss/websocket-accept-response
v1.0.0
Published
Who wants to write all this BS every single time? Nah man..
Downloads
2
Readme
@wormss/websocket-accept-response
Who wants to write all this BS every single time? Nah man..
npm i @wormss/websocket-accept-response
Example
import {
responseFromIncomingMessage
responseFromHttpHeaders,
responseFromSecWebsocketKey,
responseFromHash,
} from '@wormss/websocket-accept-response';
const response = responseFromIncomingMessage(req);
const response = responseFromHttpHeaders(req.headers);
const response = responseFromSecWebsocketKey(req.headers['sec-websocket-key']);
const response = responseFromHash(makeMyOwnHash);
socket.write(response);
Choose your level of laziness.. No judgement here.