postrank-labs/goliath — Issue #102: Images and CSS not rendering
Author: msims
Created: 2011-11-10 17:22:02+00:00
State: open

I'm trying to build a basic http proxy to proxy browser requests but for some reason images and css are not being sent back to the clients browser.

This is the code I'm using.

```
require 'goliath'
require 'em-synchrony'
require 'em-synchrony/em-http'

class CryptoProxy < Goliath::API
def response(env)
get_url = "http://#{env['HTTP_HOST']}"

gh = EM::HttpRequest.new(get_url).get
logger.info "Received #{gh.response_header.status} from #{get_url}"

[200, {'X-Goliath' => 'Proxy'}, gh.response]
end
end
```

After running the proxy, I set the proxy settings to localhost:9000 in firefox but no images and css.

If I hard code the url

```get_url = "http://www.google.co.uk"```

and access the proxy directly on localhost:9000 then the page renders fine.

Is there something I'm missing or not doing?