9seconds / topographer

Self-hosted lenient geoip service
MIT License
28 stars 4 forks source link

"Empty reply from server" when using proxy #1

Closed deti closed 6 years ago

deti commented 6 years ago

curl -x %host%:%port% __serviceurl__ -vvv

got this

* TCP_NODELAY set
* Connected to %proxy_host%. (%proxy_host%.) port %proxy_port% (#0)
> GET %service_url% HTTP/1.1
> Host: %service_url%
> User-Agent: curl/7.54.0
> Accept: */*
> Proxy-Connection: Keep-Alive
> 
* Empty reply from server
* Connection #0 to host %proxy_host%. left intact
curl: (52) Empty reply from server

I suppose this service should determine proxy's location as well as natural ip address

9seconds commented 6 years ago

Cannot reproduce:

$ docker run -d --rm=true -p 3128:3128 poklet/squid                                                                                                                                    
39b42dfd4eeb2be91d78486aea495bcf570910fc7f0487de9df18ac54a1e5828

$ docker run -d --rm=true -it -p 20000:80 nineseconds/topographer
cb11bc8c6623af23308e99733e4542e41de08be3dc37536957bf61aef0104f91

$ curl -x localhost:3128 10.0.0.10:20000/ -vvv
*   Trying ::1...
* Connected to localhost (::1) port 3128 (#0)
> GET http://10.0.0.10:20000/ HTTP/1.1
> Host: 10.0.0.10:20000
> User-Agent: curl/7.47.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: application/json
< Date: Wed, 07 Mar 2018 11:09:26 GMT
< Content-Length: 132
< X-Cache: MISS from 39b42dfd4eeb
< X-Cache-Lookup: MISS from 39b42dfd4eeb:3128
< Via: 1.0 39b42dfd4eeb (squid/3.1.10)
* HTTP/1.0 connection set to keep alive!
< Connection: keep-alive
<
{"results":{"10.201.0.2":{"country":"","city":"","details":{"maxmind":{"country":"","city":""},"sypex":{"country":"","city":""}}}}}
* Connection #0 to host localhost left intact