Use existing JS Websocket
- 主要语言
- Go
- 星标
- 5.5k
- 派生
- 372
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hello, I am wondering, with this library, is it possible to use an existing WebSocket that was created in JS land, something like
```go
exportConnect := js.FuncOf(func(this js.Value, args []js.Value) any {
// ...
socket := args[0]
conn, _, err := websocket.From(ctx, socket)
netconn := websocket.NetConn(ctx, conn, websocket.MessageBinary)
// ...
})
js.Global().Set("go__connect", exportConnect)
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start by reviewing the websocket.From and websocket.NetConn entry points shown in the issue, along with the library's WebSocket and JavaScript interop documentation. Determine whether an existing JavaScript WebSocket can be supported and define the expected behavior and tests before implementation; done means the capability is documented and verified with a working example or test.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go, javascript
- 领域
- networking, web-dev
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100