我为我构建的前端应用程序创建了一个数据库和服务器,现在我正在尝试将服务器部署到heroku。我已经设置了配置vars,在Atlas中创建了集群,服务器在本地工作。
当我部署到heroku时,我会收到这个错误MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelist
我在获取用户的ip地址到web服务器时遇到了问题。我正在使用这个代码..
//To get the local IP address
string sHostName = Dns.GetHostName();
IPHostEntry ipE = Dns.GetHostByName(sHostName);
IPAddress[] IpA = ipE.AddressList;
for (int i = 0; i < IpA.Length; i++)
{
我有一个非常简单的http服务器:
TcpListener server = new TcpListener(System.Net.IPAddress.Any, 80);
server.Start();
var client = server.AcceptTcpClient();
var ip = client.Client.RemoteEndPoint;
// ip address in here is: 166.72.162.85
// etc. read request and write response....
我的电话连接到AT&T 3G网络,我正在提出这个请求