pixel-point/kube-forwarder

services don't respond to HTTP OPTION, forwarder fails

mzeier opened this issue · 0 comments

Been trying to debug why a command line port-forward works and a kube-forwarder fails.

This is the CLI command version:

kubectl port-forward deployment/hawkeye 8080:12345

I'm able to run something like:

curl http://localhost:8080/v1/status/history

And get a successful response.

In kube-forwarder using a similar config turns the "play" icon to a "pause" icon and changes the status LED from red to blue-ish. That same curl command fails with:

Error: socket hang up

When I capture this session with Wireshark, I notice that kube-forwarder makes an initial connection and sends an HTTP OPTIONS method. For this service, it returns a 404 and I suspect this is why I get an error when trying to send anything through.

Is that true? Short of application changes on my side, is there a way to work around this?

Hypertext Transfer Protocol
    OPTIONS / HTTP/1.1\r\n
        [Expert Info (Chat/Sequence): OPTIONS / HTTP/1.1\r\n]
        Request Method: OPTIONS
        Request URI: /
        Request Version: HTTP/1.1
    Host: localhost:8080\r\n
    Connection: keep-alive\r\n
    Origin: file://\r\n
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) kube-forwarder/1.5.1 Chrome/73.0.3683.121 Electron/5.0.6 Safari/537.36\r\n
    Accept: */*\r\n
    Accept-Encoding: gzip, deflate, br\r\n
    Accept-Language: en-US\r\n
    \r\n
    [Full request URI: http://localhost:8080/]
    [HTTP request 1/1]