@electerm/electerm-react 1.34.48 → 1.34.49

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.
@@ -932,7 +932,7 @@ export default class Term extends Component {
932
932
  })
933
933
  const { cols, rows } = term
934
934
  const { config } = this.props
935
- const { host, port, tokenElecterm } = config
935
+ const { host, port, tokenElecterm, server = '' } = config
936
936
  const { sessionId, terminalIndex, id, logName } = this.props
937
937
  const tab = deepCopy(this.props.tab || {})
938
938
  const {
@@ -1013,7 +1013,11 @@ export default class Term extends Component {
1013
1013
  this.setState({
1014
1014
  pid
1015
1015
  })
1016
- const wsUrl = `ws://${host}:${port}/terminals/${pid}?sessionId=${sessionId}&token=${tokenElecterm}`
1016
+ const hs = server
1017
+ ? server.replace(/https?:\/\//, '')
1018
+ : `${host}:${port}`
1019
+ const pre = server.startsWith('https') ? 'wss' : 'ws'
1020
+ const wsUrl = `${pre}://${hs}/terminals/${pid}?sessionId=${sessionId}&token=${tokenElecterm}`
1017
1021
  const socket = new WebSocket(wsUrl)
1018
1022
  socket.onclose = this.oncloseSocket
1019
1023
  socket.onerror = this.onerrorSocket
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.34.48",
3
+ "version": "1.34.49",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",