Skip to content

Commit

Permalink
fix(hmr): base default protocol on client source location (#11497)
Browse files Browse the repository at this point in the history
  • Loading branch information
geigerzaehler committed Jan 4, 2023
1 parent 1ae018f commit 167753d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const importMetaUrl = new URL(import.meta.url)
// use server configuration, then fallback to inference
const serverHost = __SERVER_HOST__
const socketProtocol =
__HMR_PROTOCOL__ || (location.protocol === 'https:' ? 'wss' : 'ws')
__HMR_PROTOCOL__ || (importMetaUrl.protocol === 'https:' ? 'wss' : 'ws')
const hmrPort = __HMR_PORT__
const socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${
hmrPort || importMetaUrl.port
Expand Down

0 comments on commit 167753d

Please sign in to comment.