简体   繁体   中英

Cannot connect to Grapevine from another computer on the same network

I am using Grapevine 3.1.0 in VS2013. The project is called ConsoleApplication1.

After starting the server on my host machine, I can access it locally from localhost:1234 , 127.0.0.1:1234 , and 192.168.1.2:1234 (my machine's local IP address). However, even after port forwarding, I cannot connect to my external IP from any machine. Furthermore, I cannot connect with the local IP address from another machine, only from the host.

I have even made a Windows Firewall rule for the program, but to no avail.

The following code is for the server portion. Attempts to connect are made using Firefox.

//Program.cs
using System;
using System.Net;
using Grapevine.Server;

class Program
{
    static void Main(string[] args)
    {
        var server = new RESTServer(host: "*");
        server.Start();
        Console.ReadLine();
        server.Stop();
    }
}

public sealed class TestResource : RESTResource
{
    [RESTRoute]
    public void HandleAllGetRequests(HttpListenerContext context)
    {
        SendTextResponse(context, "GET is a success!");
    }
}

netstat -a reports that the server is listening. I receive a timeout message from Firefox when attempting to connect from another machine on the same network. Looking at both the host and the other machine with Fiddler, I can tell that the host machine never received any form of message after attempting to make a connection.

I ensured that I am running the program in administrator mode, but it would throw an exception if I didn't regardless.

I have tested the server on Windows 8.1 and Windows 7.

What additional steps do I need to do in order to successfully run Grapevine?

I have even made a Windows Firewall rule for the program

Did you make a Windows Firewall rule for the port ? If not, try this first . You might need to add the url to the ACL on the computer it's running on, which you can do by opening a terminal as admin and run:

netsh http add urlacl url=http://*:1234/ user=Everyone

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