Git Product home page Git Product logo

Comments (9)

 avatar commented on June 11, 2024 1

I think you can close but, even if the http headers are case-insentitive, I think it will be better to avoid modify the header. But this modification is from http-proxy and so on, in CHP.

from configurable-http-proxy.

minrk avatar minrk commented on June 11, 2024

Try replacing ws: with http: in your default-target

from configurable-http-proxy.

 avatar commented on June 11, 2024

yes, I have the same issue !

from configurable-http-proxy.

 avatar commented on June 11, 2024

I think I found the problem. When I capture the http request packet before the CHP and after it, all capitals in the header are deleted !

In the CHP :

Hypertext Transfer Protocol
GET /websockify HTTP/1.1
Host: 194.X.X.X:6351
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0\r\n
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
    Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3\r\n
    Accept-Encoding: gzip, deflate\r\n
    Sec-WebSocket-Version: 13\r\n
    Origin: http://194.X.X.X:6341\r\n
    Sec-WebSocket-Protocol: binary\r\n
    Sec-WebSocket-Extensions: permessage-deflate\r\n
    Sec-WebSocket-Key: 6VIYqTOCAUiWzMuFyT2oZg==\r\n
   Connection: keep-alive, Upgrade\r\n
    Pragma: no-cache\r\n
    Cache-Control: no-cache\r\n
    Upgrade: websocket\r\n
    \r\n
    [Full request URI: http://194.X.X.X:6351/websockify]
    [HTTP request 1/1]

Out the CHP :

Hypertext Transfer Protocol
    GET /websockify HTTP/1.1\r\n
    x-forwarded-proto: ws\r\n
    x-forwarded-port: 6351\r\n
    x-forwarded-for: ::ffff:194.X.X.X\r\n
    upgrade: websocket\r\n
    cache-control: no-cache\r\n
    pragma: no-cache\r\n
    connection: keep-alive, Upgrade\r\n
    sec-websocket-key: NQJ5RBBD7XmIxLsdFiEfVA==\r\n
    sec-websocket-extensions: permessage-deflate\r\n
    sec-websocket-protocol: binary\r\n
    origin: http://194.X.X.X:6341\r\n
    sec-websocket-version: 13\r\n
    accept-encoding: gzip, deflate\r\n
    accept-language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3\r\n
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
    user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0\r\n
    host: 194.X.X.X:6351\r\n
    \r\n
    [Full request URI: http://194.X.X.X:6351/websockify]
    [HTTP request 1/1]

from configurable-http-proxy.

minrk avatar minrk commented on June 11, 2024

HTTP header keys are case-insensitive, so if changing the case affects any behavior, there is a bug in some header handling somewhere.

from configurable-http-proxy.

 avatar commented on June 11, 2024

I confirm this bug which is from http-proxy. The httpProxy.createServer({target:'http://10.22.9.119:80'}).listen(81); modifies the headers.
All headers of the input message of http://10.22.9.119:80 are in lower case.

A first modification : change the x-forwarded- to X-Forwarded- in respect to the HTTP RFC.

from configurable-http-proxy.

minrk avatar minrk commented on June 11, 2024

All HTTP headers are case-insensitive according to HTTP specs, so anything that doesn't handle lowercase headers exactly the same as uppercase ones is not implementing HTTP correctly.

from configurable-http-proxy.

 avatar commented on June 11, 2024

Yes, I discovered that the http headers are case-insensitive but it seems that the qemu websocket option is case sensitive ! I will check the qemu code. If I use CHP which target to websockify which target to the qemu vnc, it works

from configurable-http-proxy.

willingc avatar willingc commented on June 11, 2024

@krakydark and @minrk, Is this issue ready to close? It seems that this is out of the scope of CHP. Thanks.

from configurable-http-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.