ansible / receptor

Project Receptor is a flexible multi-service relayer with remote execution and orchestration capabilities linking controllers with executors across a mesh of nodes.
Other
160 stars 81 forks source link

websockets origin incorrectly set to destination address #401

Open fosterseth opened 3 years ago

fosterseth commented 3 years ago
addrURL, err := url.Parse(address)
if err != nil {
    return nil, err
}
httpScheme := "http"
if addrURL.Scheme == "wss" {
    httpScheme = "https"
}
wd := WebsocketDialer{
    address:     address,
    origin:      fmt.Sprintf("%s://%s", httpScheme, addrURL.Host),
    redial:      redial,
    tlscfg:      tlscfg,
    extraHeader: extraHeader,
}

origin should be local hostname, not the destination url

snprajwal commented 2 years ago

Won't the host name be present in the Host header during the WebSocket handshake? Does it need to be explicitly set again as a separate header in the function that starts the session?