hullarb / ssheasy

ssh, sftp client running in the browser powered by golang and wasm
232 stars 47 forks source link

Go program exits after connection. #2

Closed km19809 closed 2 years ago

km19809 commented 2 years ago
  1. How to reproduce: Use this info to sign in.
  2. console.log: (DevTool, MS Edge 96.0.1054.62)

    
    wasm_exec.js:51 main is running
    wasm_exec.js:51 2022/01/05 18:41:33 requesting 24x104 terminal
    wasm_exec.js:51 panic: runtime error: invalid memory address or nil pointer dereference
    wasm_exec.js:51 [signal 0xb code=0x0 addr=0x0 pc=0x0]
    wasm_exec.js:51 
    wasm_exec.js:51 goroutine 7 [running]:
    wasm_exec.js:51 github.com/pkg/sftp.(*Client).RealPath(0x0, {0x52f86, 0x1})
    wasm_exec.js:51     /go/pkg/mod/github.com/pkg/sftp@v1.13.4/client.go:815 +0x2
    wasm_exec.js:51 github.com/pkg/sftp.(*Client).Getwd(...)
    wasm_exec.js:51     /go/pkg/mod/github.com/pkg/sftp@v1.13.4/client.go:842
    wasm_exec.js:51 main.getwd()
    wasm_exec.js:51     /go/src/web/browser.go:133 +0x4
    wasm_exec.js:51 main.main.func1.1({0x482070, 0x7, 0x7})
    wasm_exec.js:51     /go/src/web/main.go:140 +0x106
    wasm_exec.js:51 created by main.main.func1
    wasm_exec.js:51     /go/src/web/main.go:29 +0x2
    wasm_exec.js:151 
    
       exit code: 2
    exit @ wasm_exec.js:151

3. description: After trying to connect `rlgallery.org`, the client unexpectedly exited.
It showed me the initial screen of `rlgallery`, but I can not type anything.
hullarb commented 2 years ago

Thanks for reporting this issue. It seems SFTP is not supported by this service and this caused the panic shown in the logs. I pushed a commit to prevent the ssh client from stopping in such a case. Changes are pushed to ssheasy.com and connection seems to be working fine now with rlgallery.org.

km19809 commented 2 years ago

Issue resolved. Thank you so much!