Files
rtcnet/ws_wasm.go
2023-04-20 08:16:16 -04:00

17 lines
370 B
Go

// +build js
package rtcnet
import (
"context"
"crypto/tls"
"nhooyr.io/websocket"
)
// Note: You cant inject tlsConfig here, you are required to use the tlsConfiguration as defined by the browser.
func dialWs(ctx context.Context, url string, tlsConfig *tls.Config) (*websocket.Conn, error) {
wsConn, _, err := websocket.Dial(ctx, url, nil)
return wsConn, err
}