Skip to content

Commit 2bc4dd4

Browse files
committed
fix(client): don't override protocol for socket connection to 127.0.0.1
Chrome and Firefox accept `http://`/`ws://` mixed-content connection to `127.0.0.1` even when the actual website is loaded via `https://`. Fixes webpack#2302
1 parent 969b580 commit 2bc4dd4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

client-src/default/utils/createSocketUrl.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function createSocketUrl(resourceQuery) {
5050
// because the browser doesn't accept non-secure websockets.
5151
if (
5252
hostname &&
53+
hostname !== '127.0.0.1' &&
5354
(self.location.protocol === 'https:' || urlParts.hostname === '0.0.0.0')
5455
) {
5556
protocol = self.location.protocol;

0 commit comments

Comments
 (0)