Listener only works with localhost REST requests...

Jan 16, 2015 at 12:42 AM
Edited Jan 16, 2015 at 12:45 AM
No matter if I structure as "http://localhost:" or "http://172.16.173.141:" + port, the listener can only hear REST requests from the local machine. It does not hear requests from remote machines.

The listener compiles and says it's listening on the address (http://172.16.173.141:34568/test), but only local requests are returned (200 status). Remote requests (from another machine) simply timeout.

What could be the root cause of this?

Listener setup code:
int _tmain(int argc, _TCHAR* argv[])
{
  utility::string_t port = U("34568");
  utility::string_t address = U("http://172.16.173.141:");
  address.append(port);

  on_initialize(address);
  ...
Jan 16, 2015 at 12:45 AM
Hi stja,

What are your firewall settings? This sounds exactly like what would happen if your firewall is not allowing connections from remote machines (the default). The fastest way to test this is to temporarily disable your firewall.

roschuma
Jan 16, 2015 at 12:56 AM
Edited Jan 16, 2015 at 12:59 AM
Thanks for the speedy reply.

I can't disable the firewall due to corp IT policy.

However, I thought that too and explicitly set a policy to allow the app.

I'm also on an open Wifi connection and both client and server are on the same segment. I can ping the other machine just fine.

Puzzled...
Jan 16, 2015 at 12:58 AM
Hi stja,

On Windows we build on top of the Windows HTTP Server API and to listen to a request across machines you need to run as an Administrator. I would try use '*' as the hostname and run as an admin. You shouldn't have any problems receiving requests from another machine then.

Steve
Jan 16, 2015 at 1:03 AM
Two other things might defeat your efforts then:

1) Your IT might have set an override which only allows domain joined computers to connect to any port on your local machine, regardless of your exceptions.
2) Your wireless access point might have "AP Isolation" enabled, which prevents computers connected wirelessly from talking to each other.
Jan 16, 2015 at 1:17 AM
I'm not following the * hostname. Does that mean:
  utility::string_t address = U("http://*:"); ?
I assume running as admin means building then running the resultant app (Debug directory) as admin but do correct me if I have that wrong.

Thanks Steve.
Jan 16, 2015 at 1:19 AM
Good point about the AP Isolation. I'll get on a clean wifi segment (or hardwired) and test that out. Thanks roschuma.
Jan 16, 2015 at 1:21 AM
Yes use the asterisk character for the hostname. So it looks like you want something like this:

http://*:34568/

Steve