An archive of community.esquilo.io as of Saturday January 26, 2019.

# Esquilo talking to a port other than 80?

robertjensen

Does the HTTPC class accept a port number as part of the IP address? It didn't seem to work when I tried it. I could communicate with HTTPC to a device on my LAN on port 80, but not one that listens on another port. An earlier thread established that the Esquilo will not (currently) listen on an assigned port. Now I'm interested in knowing if it will talk to a device on an assigned port.

patrick

The second parameter to HTTPC is the port. You should be able to pass an integer to this, like so:

local http = HTTPC("example.com", 8080);

We do this often for SSL, by passing 443. If that doesn't work, it's a bug. I'll set up a test today and get back to you.

patrick

This works for me:

require("HTTPC");
local httpc = HTTPC("192.168.1.100", 3000);
httpc.get("/");
print(httpc.readstr(1000));
robertjensen

Once more I don't see how I overlooked that part of the documentation. Sorry for the clutter. Thanks.