MCPcopy
hub / github.com/rclone/rclone / websocketDial

Method websocketDial

backend/cache/plex.go:112–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110}
111
112func (p *plexConnector) websocketDial() (*websocket.Conn, error) {
113 u := strings.TrimRight(strings.Replace(strings.Replace(
114 p.url.String(), "http://", "ws://", 1), "https://", "wss://", 1), "/")
115 url := fmt.Sprintf(defPlexNotificationURL, u, p.token)
116
117 config, err := websocket.NewConfig(url, "http://localhost")
118 if err != nil {
119 return nil, err
120 }
121 if p.insecure {
122 config.TlsConfig = &tls.Config{InsecureSkipVerify: true}
123 }
124 return websocket.DialConfig(config)
125}
126
127func (p *plexConnector) listenWebsocket() {
128 p.runningMu.Lock()

Callers 1

listenWebsocketMethod · 0.95

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected