Skip to content

Use existing JS Websocket #456

Open
Open
@foxt

Description

@foxt

Hello, I am wondering, with this library, is it possible to use an existing WebSocket that was created in JS land, something like

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions