MCPcopy Create free account
hub / github.com/cli/gh-webhook / dial

Function dial

webhook/forward.go:139–151  ·  view source on GitHub ↗

dial connects to the websocket server

(token, url string)

Source from the content-addressed store, hash-verified

137
138// dial connects to the websocket server
139func dial(token, url string) (*websocket.Conn, error) {
140 h := make(http.Header)
141 h.Set("Authorization", token)
142 c, resp, err := websocket.DefaultDialer.Dial(url, h)
143 if err != nil {
144 if resp != nil {
145 body, _ := io.ReadAll(resp.Body)
146 err = fmt.Errorf("code: %v - body: %s - err: %w", resp.StatusCode, body, err)
147 }
148 return nil, err
149 }
150 return c, nil
151}
152
153type httpEventForward struct {
154 Status int

Callers 1

handleWebsocketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected