Skip to content

Commit

Permalink
Update web_socket_server.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqxx authored Jun 15, 2023
1 parent 6055643 commit aba24ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_socket_server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function WebSocketServer(options : Deno.ServeOptions | Deno.ServeTlsOptions, handler : (webSocket : WebSocket, request? : Request) => void) {
Deno.serve({...options, onListen({hostname, port}) {
console.log(`Listening on ws://${hostname || 'localhost'}:${port}/ (WebSocketServer)`);
console.log(`Listening on ws://${hostname}:${port}/ (WebSocketServer)`);
}}, (request) => {
if (request.headers.get("upgrade") != "websocket") {
return new Response(null, { status: 501 });
Expand Down

0 comments on commit aba24ce

Please # to comment.