简体   繁体   English

无法从同一网络上的另一台计算机连接到Grapevine

[英]Cannot connect to Grapevine from another computer on the same network

I am using Grapevine 3.1.0 in VS2013. 我在VS2013中使用Grapevine 3.1.0。 The project is called ConsoleApplication1. 该项目称为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). 开始我的主机上的服务器后,我可以从本地访问localhost:1234127.0.0.1:1234192.168.1.2:1234 (我的机器的本地IP地址)。 However, even after port forwarding, I cannot connect to my external IP from any machine. 但是,即使在端口转发后,我也无法从任何机器连接到我的外部IP。 Furthermore, I cannot connect with the local IP address from another machine, only from the host. 此外,我无法从另一台机器连接本地IP地址,只能从主机连接。

I have even made a Windows Firewall rule for the program, but to no avail. 我甚至为该程序制定了Windows防火墙规则,但无济于事。

The following code is for the server portion. 以下代码适用于服务器部分。 Attempts to connect are made using Firefox. 尝试连接是使用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. netstat -a报告服务器正在侦听。 I receive a timeout message from Firefox when attempting to connect from another machine on the same network. 尝试从同一网络上的另一台计算机进行连接时,我收到来自Firefox的超时消息。 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. 用Fiddler查看主机和其他机器,我可以看出主机在尝试建立连接后从未收到过任何形式的消息。

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. 我在Windows 8.1和Windows 7上测试了服务器。

What additional steps do I need to do in order to successfully run Grapevine? 为了成功运行Grapevine,我还需要做些哪些其他步骤?

I have even made a Windows Firewall rule for the program 我甚至为该程序制定了Windows防火墙规则

Did you make a Windows Firewall rule for the port ? 您是否为端口制定了Windows防火墙规则? 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: 可能需要将URL添加到运行它的计算机上的ACL,您可以通过以管理员身份打开终端来执行以下操作:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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