pimelon-ui 0.1.57 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/socketio.js +2 -1
package/package.json
CHANGED
package/src/utils/socketio.js
CHANGED
|
@@ -2,10 +2,11 @@ import { io } from 'socket.io-client'
|
|
|
2
2
|
|
|
3
3
|
export default function initSocket(options = {}) {
|
|
4
4
|
let host = window.location.hostname
|
|
5
|
+
let siteName = import.meta.env.DEV ? host : window.site_name
|
|
5
6
|
let socketio_port = options.port || 9000
|
|
6
7
|
let port = window.location.port ? `:${socketio_port}` : ''
|
|
7
8
|
let protocol = port ? 'http' : 'https'
|
|
8
|
-
let url = `${protocol}://${host}${port}`
|
|
9
|
+
let url = `${protocol}://${host}${port}/${siteName}`
|
|
9
10
|
let socket = io(url, { withCredentials: true })
|
|
10
11
|
return socket
|
|
11
12
|
}
|