doulu1914 2018-07-25 01:01
浏览 80
已采纳

安全网络套接字的协议是什么?

We've installed a Mattermost server and it works well.

We can only connect via http. Https gives an error.

The line of code that fails is

webSocketClient, err := model.NewWebSocketClient4("ws://mattermost.example.com", client.AuthToken)

make run
go run   *.go
Mattermost Bot Sample
Server detected and is running version 5.1.0
We failed to connect to the web socket
    Error Details:
        model.websocket_client.connect_fail.app_error
        model.websocket_client.connect_fail.app_error
        websocket: bad handshake
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x13e1e55]

We opened up the http port 8065 and when we connect to port 8065, without ssl, it works.

webSocketClient, err := model.NewWebSocketClient4("ws://mattermost.example.com:8065", client.AuthToken)

What is the protocol for a secure websocket?

  • 写回答

1条回答 默认 最新

  • douliaotong4944 2018-07-25 01:23
    关注

    Normal websocket uses "ws://example.com"

    Secure websocket uses "wss://example.com"

    Note that some frameworks automatically handle this for you if you just leave off the ws: or wss: entirely.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?