Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Unable to call client:request using 127.0.0.1 #1

Open
nrgyzer opened this issue Mar 16, 2013 · 0 comments
Open

Unable to call client:request using 127.0.0.1 #1

nrgyzer opened this issue Mar 16, 2013 · 0 comments

Comments

@nrgyzer
Copy link

nrgyzer commented Mar 16, 2013

Hi,

my code is the following:

local http = require "resty.http"
local client = http:new()
client:set_timeout(3000)

local ok, err = client:connect("127.0.0.1", 9999)

if not ok then
    ngx.say(err)
    return
end

ngx.say("abc");
local res, err = client:request({path = "/requestedFile"})
ngx.say("def");
ngx.flush(true);

nginx writes "abc", but no "def" or similar (for testing purposes). It seems that client:request() throws an error or something similar that forces nginx to cancel the execution. Is there anything special by using 127.0.0.1/localhost? I also tried localhost instead of 127.0.0.1 but I always got "localhost could not be resolved (3: Host not found)".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant