Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Something weird with accessing through a node.js proxy?
1 point by tonyarkles on Oct 4, 2011 | hide | past | favorite | 4 comments
I'm experimenting with the nodejitsu node-http-proxy (https://github.com/nodejitsu/node-http-proxy), and my super simple proxy seems to be working well. I've just tried surfing around to a bunch of sites I normally visit, and they've loaded fine.

Unfortunately, when I try to load HN with the proxy running, I just get a blank screen that says "Unknown." Does anyone know anything about that? Experienced it before?




do a `curl -v <url>` and paste the output.


Without the proxy:

$ curl -v http://news.ycombinator.com/ * About to connect() to news.ycombinator.com port 80 (#0) * Trying 174.132.225.106... connected * Connected to news.ycombinator.com (174.132.225.106) port 80 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3 > Host: news.ycombinator.com > Accept: / > < HTTP/1.1 200 OK < Content-Type: text/html; charset=utf-8 < Cache-Control: private < Connection: close < Cache-Control: max-age=0 < -- snipped out the expected content --

$ curl -v -x localhost:8010 http://news.ycombinator.com/ * About to connect() to proxy localhost port 8010 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8010 (#0) > GET http://news.ycombinator.com/ HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3 > Host: news.ycombinator.com > Accept: / > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < content-type: text/html; charset=utf-8 < cache-control: private < connection: close < Transfer-Encoding: chunked < * Closing connection #0

Even more strange is in Safari and Chrome, the HN returns the string "Unknown.", but with curl, it doesn't seem to even return that.


Awwww, it ate the newlines.

Without the proxy:

  $ curl -v http://news.ycombinator.com/
  * About to connect() to news.ycombinator.com port 80 (#0)
  *   Trying 174.132.225.106... connected
  * Connected to news.ycombinator.com (174.132.225.106) port 80 (#0)
  > GET / HTTP/1.1
  > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7   OpenSSL/0.9.8r zlib/1.2.3
  > Host: news.ycombinator.com
  > Accept: */*
  > 
  < HTTP/1.1 200 OK
  < Content-Type: text/html; charset=utf-8
  < Cache-Control: private
  < Connection: close
  < Cache-Control: max-age=0
  < 
-- snipped out the expected content --

  $ curl -v -x localhost:8010 http://news.ycombinator.com/
  * About to connect() to proxy localhost port 8010 (#0)
  *   Trying 127.0.0.1... connected
  * Connected to localhost (127.0.0.1) port 8010 (#0)
  > GET http://news.ycombinator.com/ HTTP/1.1
  > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
  > Host: news.ycombinator.com
  > Accept: */*
  > Proxy-Connection: Keep-Alive
  > 
  < HTTP/1.1 200 OK
  < content-type: text/html; charset=utf-8
  < cache-control: private
  < connection: close
  < Transfer-Encoding: chunked
  < 
  * Closing connection #0
Even more strange is in Safari and Chrome, the HN returns the string "Unknown.", but with curl, it doesn't seem to even return that.


I just want to make sure I've pointed out that it's only on HN that I get this problem (so far). I surfed around for a while through the proxy (reddit, slashdot, a few other places) and they all worked fine.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: