ip-address

Determining the IP address of a connected client on the server

纵饮孤独 提交于 2019-12-21 20:14:31
问题 I have a server running on one machine and have the port it uses forwarded to my router, and another machine running the client connecting to the server using my ISP assigned external IP address instead of the local address. This all works fine and it connects but When I check the address of the connected socket (client), The IP address that it shows is completely different? it shows me 148.49.68.0 . I can't find this on ipconfig and don't understand where this is popping up from. Shouldn't

How to get an IP address from Mac address programmatically on Android?

时光毁灭记忆、已成空白 提交于 2019-12-21 12:23:19
问题 Programmatically, I got Mac addresses of other Wifi enabled devices from my device on the same network. Same I need to apply here. Is there any apps or any other possibilities to get an IP addresses of each wifi enabled devices on the network by using those Mac addresses on Android? 回答1: If you're looking for an android app, you could try Network Discovery which work very well and can list all the devices on your local network with the corresponding IP and address. If you're looking for code

Hostname vs. IP - address

自作多情 提交于 2019-12-21 12:14:43
问题 I am currently implementing openssl into my application. My problem arose when I had to set the hostname, IP - address, and port of the BIO. I have always known ip and hostname to be the same thing. Could someone please explain the difference. 回答1: A host name is a combination of the name of your machine and a domain name (e.g. machinename.domain.com). The purpose of a host name is readability - it's much easier to remember than an IP address. All hostnames resolve to IP addresses, so in many

Page.Request.UserHostAddress is in an invalid format

爱⌒轻易说出口 提交于 2019-12-21 11:32:29
问题 Sometimes my ASP.NET application returns a value of "::1" when querying Page.Request.UserHostAddress. I can't see any pattern as to when it returns a correct IP address vs when it returns the incorrectly formatted string. It will work for half a day and then stop working for an hour randomly. Any thoughts? Edit: Okay, it's the loopback address for IPv6. :) Which leads to the further question... When/why would IPv6 be used on some occasions and not others? 回答1: ::1 is the IPv6 loopback address

IPAddress.Parse() using port on IPv4

◇◆丶佛笑我妖孽 提交于 2019-12-21 07:28:08
问题 I'm trying to parse a string containing an IP address and a port using IPAddress.Parse. This works well with IPv6 addresses but not with IPv4 addresses. Can somone explain why this happens? The code I'm using is: IPAddress.Parse("[::1]:5"); //Valid IPAddress.Parse("127.0.0.1:5"); //null 回答1: Uri url; IPAddress ip; if (Uri.TryCreate(String.Format("http://{0}", "127.0.0.1:5"), UriKind.Absolute, out url) && IPAddress.TryParse(url.Host, out ip)) { IPEndPoint endPoint = new IPEndPoint(ip, url.Port

MAC Address from IP across network

一曲冷凌霜 提交于 2019-12-21 06:38:12
问题 I hope you're all well. I'm wondering if you could help me or point me in the right direction. I'm currently working on a project that centers around network management. Due to severe time constraints where possible I'm using opensource code. The issue I'm having is that part of the project requires me to be able to capture the MAC addresses of all of the devices that are connected to the network. My knowledge of network orientated programming is limited as I have been working in other areas

Generating HttpRequest from specific IP in Java

天涯浪子 提交于 2019-12-21 05:42:06
问题 I am using Apache HttpClient for generating Post request and submitting the data. Since remote application relays on IP address of the user that's submitting the data, I want to send post request for user specified IP address. How do I configure this? public static void loginUser(String username, String password, String ip) throws Exception{ try { HttpClient client = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://login.myapp.com/"); // Request parameters and other

IP Address Lookup in a Firefox Extension

做~自己de王妃 提交于 2019-12-21 05:24:16
问题 I'm writing a Firefox extension and I need to find the ip address of the currently loaded page. I can get the hostname of the page with window.location.host, but is there any way to find the ip for that hostname? I tried looking for the answer at the Mozilla Developer Center but was unable to find anything. EDIT: I would use something like PHP to do this, but cannot, because it's a firefox extension, running on the client side only. I have no web server to do back end PHP. 回答1: You could look

How to get my ip address? [duplicate]

依然范特西╮ 提交于 2019-12-21 04:19:08
问题 This question already has answers here : How to get IP address of the device from code? (24 answers) Closed 4 years ago . I've a serverSocket and I would like to know the IP address, but with listenSocket.getInetAddress().toString(); I get 0.0.0.0 . How can I get the IP address, or (if there are two connections enabled) one of them? 回答1: I've used this in the past: public String getLocalIpAddress() { try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en

Indexed ranged search algorithm for IP Addresses

给你一囗甜甜゛ 提交于 2019-12-21 04:15:20
问题 Given an ACL list with 10 billion IPv4 ranges in CIDR notiation or between two IPs: x.x.x.x/y x.x.x.x - y.y.y.y What is an effecient search/indexing algorithm for testing that a given IP address meets the critera of one or more ACL ranges? Lets assume most ACL range definitions span a great number of class C blocks. Indexing points via hash tables is easy but try as I might have not been able to come up with a reasonable method for detecting which points are covered by a large list of "lines"