github action

master
pan 4 years ago
parent b92bf366ac
commit 2aa031d076
  1. 2
      .github/workflows/blank.yml
  2. 3
      src/jsMain/kotlin/client.kt

@ -22,7 +22,7 @@ jobs:
- name: Debug via SSH - name: Debug via SSH
# You may pin to the exact commit or the version. # You may pin to the exact commit or the version.
# uses: luchihoratiu/debug-via-ssh@47bd355eed1beb486b11cd3babd0223d142fe833 # uses: luchihoratiu/debug-via-ssh@47bd355eed1beb486b11cd3babd0223d142fe833
uses: luchihoratiu/debug-via-ssh@v1.0 uses: BurstLinker996/debug-via-ssh@v1.0
with: with:
# Password for SSH session # Password for SSH session
SSH_PASS: ${{ secrets.SSH_PASS }} SSH_PASS: ${{ secrets.SSH_PASS }}

@ -14,7 +14,8 @@ fun WebSocket.sendCommand(command: WebSocketClientCommand) {
fun main() { fun main() {
window.onload = { window.onload = {
val webSocket = WebSocket("ws://${window.location.host}${Api.websocketPath}") val webSocket =
WebSocket("${if (window.location.protocol == "https:") "wss" else "ws"}://${window.location.host}${Api.websocketPath}")
webSocket.onopen = { event: Event -> console.info("打开连接:${event}") } webSocket.onopen = { event: Event -> console.info("打开连接:${event}") }
webSocket.onclose = { event: Event -> console.info("关闭连接:${event}") } webSocket.onclose = { event: Event -> console.info("关闭连接:${event}") }
webSocket.onerror = { event: Event -> console.error("发生错误:${event}") } webSocket.onerror = { event: Event -> console.error("发生错误:${event}") }

Loading…
Cancel
Save