我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

使用错误的WebSocket协议在gorilla / websocket / client.go的Dial函数中返回“意外的EOF”错误

I was trying to connect to a server in Go by using gorilla/websocket and I kept getting the error "unexpected EOF". It took me way too long to find out it was because I needed to use the secure WebSocket protocol to connect to that server ("wss://" instead of "ws://" in my url).

How can I verify that I'm using the wrong protocol for a given endpoint so that I can log a helpful error message instead of "unexpected EOF"?

近期文章

  • 使用功能进行Golang测试
  • 将_id解组为ID无效
  • 从重复范围创建函数
  • 尝试将ajax获取请求发送到Go网络服务器,但响应给出500内部服务器错误
  • 类型的导入周期
  • Golang exec .bat或.exe文件,但未获得输出
  • 如何选择单个列和组数组
  • 交叉编译到ARMv7失败
  • 无法在macOS Sierra上的Gogland 1.0 EAP中启动调试
  • 如何在MongoDB中通过搜索执行Joinquery并执行操作?
  • Golang:命令行参数未定义:变量
  • 前进:当前RSS缓慢增加而没有堆
  • golang simplejson mustint64不会从字符串转换为int64
  • Golang解组将结构索引更改为定义值
  • 命名查询无法解析地图
  • 如何用goterm绘制图表?
  • FD Leak,我应该如何重构代码?
  • 使用依赖项的修改版本时,Go会抱怨类型错误
  • 在保留分隔符的同时分割字符串
  • 如何从HTTP响应中读取附件

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华