Skip to content

Feature request : websocket support (and altering of host header) #49

@nicolaspernoud

Description

@nicolaspernoud

Hello,

Thanks for this useful work.

It would be nice if this reverse proxy allowed proxying of websockets, as Go proxy does.

I tried proxying "websocketstest.com" through this proxy and it does not work.

Also, to do this proxying (as well with www.example.com), I needed to alter the host header to match the host of the proxy target in the filtered_data_to_request function. It could be nice if it was done by default, to allow proxying servers with virtual hosts.

Thanks and best regards.

PS : the (dirty) way I replaced the host header below :

    let host = proxy_address
        .replace("https://", "")
        .replace("http://", "")
        .replace("/", "");

    let proxy_uri = if let Some(params) = params {
        format!("{}?{}", proxy_address, params)
    } else {
        proxy_address
    };

    let mut headers = remove_hop_headers(&headers);
    headers.insert("host", host.parse().unwrap());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions