Skip to content

Commit a2c0d44

Browse files
committedDec 28, 2020
[minor] Silence deprecation warning
Fixes #1829
1 parent c171962 commit a2c0d44

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎lib/websocket.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ function tlsConnect(options) {
695695
options.path = undefined;
696696

697697
if (!options.servername && options.servername !== '') {
698-
options.servername = options.host;
698+
options.servername = net.isIP(options.host) ? '' : options.host;
699699
}
700700

701701
return tls.connect(options);

‎test/websocket.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,7 @@ describe('WebSocket', () => {
21232123
});
21242124

21252125
server.listen(0, () => {
2126-
const ws = new WebSocket(`wss://localhost:${server.address().port}`, {
2126+
const ws = new WebSocket(`wss://127.0.0.1:${server.address().port}`, {
21272127
rejectUnauthorized: false
21282128
});
21292129
});

0 commit comments

Comments
 (0)
Please sign in to comment.