![](/img/trans.png)
[英]Trying to copy a file from my computer to another computer on the same network
[英]Cannot connect to Grapevine from another computer on the same network
我在VS2013中使用Grapevine 3.1.0。 该项目称为ConsoleApplication1。
开始我的主机上的服务器后,我可以从本地访问localhost:1234
, 127.0.0.1:1234
和192.168.1.2:1234
(我的机器的本地IP地址)。 但是,即使在端口转发后,我也无法从任何机器连接到我的外部IP。 此外,我无法从另一台机器连接本地IP地址,只能从主机连接。
我甚至为该程序制定了Windows防火墙规则,但无济于事。
以下代码适用于服务器部分。 尝试连接是使用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
报告服务器正在侦听。 尝试从同一网络上的另一台计算机进行连接时,我收到来自Firefox的超时消息。 用Fiddler查看主机和其他机器,我可以看出主机在尝试建立连接后从未收到过任何形式的消息。
我确保我在管理员模式下运行该程序,但如果我不这样做,它会抛出异常。
我在Windows 8.1和Windows 7上测试了服务器。
为了成功运行Grapevine,我还需要做些哪些其他步骤?
我甚至为该程序制定了Windows防火墙规则
您是否为端口制定了Windows防火墙规则? 如果没有, 请先试试 。 您可能需要将URL添加到运行它的计算机上的ACL,您可以通过以管理员身份打开终端来执行以下操作:
netsh http add urlacl url=http://*:1234/ user=Everyone
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.