简体   繁体   中英

Self-hosting ServiceStack REST Service on local network

I was wondering if anyone could help - I have a local network (wireless, my computer and a laptop connected to it) and I've tried hosting a rest service developed with ServiceStack on it. If I run the application on the computer (a console app for now) and try to access the service using the machine IP or 127.0.0.1 it works fine - but if I try and access it from the laptop, using the computer's IP it simply stalls, and the REST service is never called.

I've tried turning off all firewalls etc, running everything in Admin mode but still nothing.. am I missing something simple to get this working?

Any help is much appreciated!

Some of the code samples (My AppHost class is inheriting from the AppHostHttpListenerBase)

restServiceToStart.Value.Init ();
restServiceToStart.Value.Start (_HostUri);

where for my main machine, the _HostUri is set to "http://my-ip-address:8080/"

You haven't listed the code you use to start your AppHost (please be descriptive when asking questions) so I'm going to assume you're not listening to http://*:{port}/ , eg from the Self Hosting wiki :

var appHost = new AppHost();
appHost.Init();
appHost.Start("http://*:1337/");

The * wildcard says to listen on every local network interface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM