Skip to content

Reverse proxy returns "Empty reply from server" #285

@davidt99

Description

@davidt99

Describe the bug
I'm trying to use the reverse proxy plugin but I keep getting "Empty reply from server" from curl.

To Reproduce
Steps to reproduce the behavior:

  1. Run proxy --log-level d --hostname 0.0.0.0 --port 8899 --plugins proxy.plugin.ReverseProxyPlugin
  2. Run curl -v 0.0.0.0:8899/get
  3. curl is doing the TCP handshake but then hangs for few seconds and then yields: "Empty reply from server"

Expected behavior
The JSON that is returned from http://httpbin.org/get

Version information

  • OS: ubuntu 18.04
  • proxy.py: Version 2.1.2
  • python: 3.6.9 or 3.7.5

Additional context

proxy logs:

proxy --log-level d --hostname 0.0.0.0 --port 8899  --plugins proxy.plugin.ReverseProxyPlugin
2020-02-02 11:50:29,030 - pid:4282 [I] load_plugins:525 - Loaded plugin proxy.http.proxy.HttpProxyPlugin
2020-02-02 11:50:29,030 - pid:4282 [I] load_plugins:525 - Loaded plugin proxy.plugin.ReverseProxyPlugin
2020-02-02 11:50:29,030 - pid:4282 [I] listen:63 - Listening on 0.0.0.0:8899
2020-02-02 11:50:29,031 - pid:4282 [D] start_workers:81 - Started acceptor#0 process 4286
2020-02-02 11:50:29,033 - pid:4282 [D] start_workers:81 - Started acceptor#1 process 4287
2020-02-02 11:50:29,034 - pid:4282 [D] start_workers:81 - Started acceptor#2 process 4288
2020-02-02 11:50:29,035 - pid:4282 [D] start_workers:81 - Started acceptor#3 process 4289
2020-02-02 11:50:29,037 - pid:4282 [D] start_workers:81 - Started acceptor#4 process 4290
2020-02-02 11:50:29,038 - pid:4282 [D] start_workers:81 - Started acceptor#5 process 4291
2020-02-02 11:50:29,039 - pid:4282 [D] start_workers:81 - Started acceptor#6 process 4292
2020-02-02 11:50:29,041 - pid:4282 [D] start_workers:81 - Started acceptor#7 process 4293
2020-02-02 11:50:29,042 - pid:4282 [D] start_workers:81 - Started acceptor#8 process 4294
2020-02-02 11:50:29,044 - pid:4282 [D] start_workers:81 - Started acceptor#9 process 4295
2020-02-02 11:50:29,045 - pid:4282 [D] start_workers:81 - Started acceptor#10 process 4296
2020-02-02 11:50:29,047 - pid:4282 [D] start_workers:81 - Started acceptor#11 process 4297
2020-02-02 11:50:29,047 - pid:4282 [I] start_workers:84 - Started 12 workers
2020-02-02 11:50:31,384 - pid:4288 [D] initialize:145 - Handling connection <socket.socket fd=15, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('127.0.0.1', 8899), raddr=('127.0.0.1', 42290)>
2020-02-02 11:50:31,385 - pid:4288 [D] handle_readables:302 - Client is ready for reads, reading
2020-02-02 11:50:31,385 - pid:4288 [D] recv:65 - received 79 bytes from client
2020-02-02 11:50:41,398 - pid:4288 [D] run:402 - Client buffer is empty and maximum inactivity has reached between client and server connection, tearing down...
2020-02-02 11:50:41,399 - pid:4288 [D] shutdown:217 - Closing client connection <socket.socket fd=15, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('127.0.0.1', 8899), raddr=('127.0.0.1', 42290)> at address ('127.0.0.1', 42290) has buffer False
2020-02-02 11:50:41,399 - pid:4288 [D] shutdown:225 - Client connection shutdown successful
2020-02-02 11:50:41,399 - pid:4288 [D] shutdown:230 - Client connection closed

curl logs:

curl -v 0.0.0.0:8899/get
*   Trying 0.0.0.0...
* TCP_NODELAY set
* Connected to 0.0.0.0 (127.0.0.1) port 8899 (#0)
> GET /get HTTP/1.1
> Host: 0.0.0.0:8899
> User-Agent: curl/7.58.0
> Accept: */*
> 
* Empty reply from server
* Connection #0 to host 0.0.0.0 left intact
curl: (52) Empty reply from server

Metadata

Metadata

Assignees

Labels

BugBug report in proxy server

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions