From 30807879301bee9907f869af4f77468d93bc47d3 Mon Sep 17 00:00:00 2001 From: nopeless <38830903+nopeless@users.noreply.github.com> Date: Wed, 13 Apr 2022 03:51:55 +0900 Subject: [PATCH] Make cjs example compatible with esm --- examples/ssl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ssl.js b/examples/ssl.js index ad08632b1..a5e750b79 100644 --- a/examples/ssl.js +++ b/examples/ssl.js @@ -3,14 +3,14 @@ const https = require('https'); const fs = require('fs'); -const WebSocket = require('..'); +const { WebSocket, WebSocketServer } = require('..'); const server = https.createServer({ cert: fs.readFileSync('../test/fixtures/certificate.pem'), key: fs.readFileSync('../test/fixtures/key.pem') }); -const wss = new WebSocket.Server({ server }); +const wss = new WebSocketServer({ server }); wss.on('connection', function connection(ws) { ws.on('message', function message(msg) {