How to identify proxy protocol from IP and Port? - proxy

Say I have a list of proxies - I pull out of one of these proxies. It's nothing but ip and port. From a programming level, you need to know the protocol to use such as socks5, socks5h, http, https... etc etc. Is there a way to retrieve what kind of protocol a proxy uses from the information given?

If you are using Node.js you can try check-proxy library, though it does much more than just checking protocol.

Your proxy server identify the port number for example 6080,9180,etc so you can easily identify the proxy server.
Your id address also private or public you can use 'proxy server ip address' that automatically create a virtual proxy network.
Example: Your private ip address is 172.16.10.158 you can use proxy server, your ip address will be 136.56.89.210. You can use public ip ex 125.124.85.69 change in to 179.68.36.49.

Related

How does Go's net library determine req.RemoteAddr field?

Researching on how a server can figure out a client's IP address, I see that one needs to inspect the X-Forwarded-For header chain.
I understand that the client, ISP, and then routers and proxies declare their IP addresses there.
However, the server handler also has access to req.RemoteAddr field to read the client's IP address. How is that RemoteAddr determined exactly? Is it based on a specific header in the request? If yes, which one(s)?
I have tried inspecting the usage of the field and how it is set but the implementation details are hidden behind an interface.
The net/http server sets RemoteAddr to the string form of the network connection's remote address. The string is typically in the format "IP:port".
In the case of a TCP connection (the typical scenario), the network connection remote address is taken from the IP source address and the TCP source port.
The address can be the address of the client or a proxy.
The net/http server does not consider the headers when setting RemoteAddr.

Why speedtest.net know my IP address even though I had used a proxy?

I am using my own squid proxy server,when I check my ip address on whatismyip.com, it show the ip address of my proxy server.
But, when I check on speedtest.net, I found that they can track my client IP.
Is there any ways to prevent my real IP being detected ???
Your IP is provided by your ISP (internet service provider) and speedtest.net picks up your gateway/router.
Thus "trying" to hide behind a proxy would not have any effect.

Ruby TCPSocket Server - Can I tell to what host a client was connecting?

I have a ruby server based on TCPSocket (non-HTTP).
I have 2 different domains, both pointing with an A-Record to my servers IP Address (the same one). So, there are clients connecting to one of those domains.
Is it possible to tell which domain a client was connecting to?
I saw that this is possible in other protocols, but I'm not sure if this is based on manually added headers or really extracted from the basic tcp/ip connection. E.g. in PHP there is $_SERVER["HTTP_HOST"] which shows to which domain a client was connecting.
At the TCP socket level, the only things that are known are the source and destination IP addresses (and ports) of the connection. How the IP address was resolved via DNS is not possible to know at this layer. Even though HTTP works on top of TCP, HTTP servers have to look at the HTTP headers from the client to know which domain they are making a request to. (That's how the HTTP_HOST value gets filled in.)
One possible solution is to configure your server to have an additional IP address. This can be by assigning an additional IP address to the NIC or adding an additional NIC. Then have each domain use a different IP address. Otherwise, this is not possible and you may want to consider your application protocol on top of TCP to convey this information.

WebAuthenticationDetails getRemoteAddress() not returning real ip address of client

I am using WebAuthenticationDetails in my application.The method of WebAuthenticationDetails's getRemoteAddress() returns same IP address even if i login in application from different client machine.This may be due to proxy server.Can anybody help me to resolve this issue?
If your app is working behind a reverse proxy (for example nginx, Apache, etc.) then you'll always see IP of the reverse proxy machine in the WebAuthenticationDetails object. To solve this problem you can configure your reverse proxy in such a way that it will send client's IP address to your application server using a HTTP header. Then in your webapp get clinet's IP from this header.

Determining local IP address in P2P application

I am developing an P2P application where a peers talk to the server to inform its Private and Public IP. The application uses UDP for communication.
To get the private IP the client uses gethostbyname and bind it to that IP. The problem is when the system has more than one NIC. The problem is when one of the NIC is not connected to internet. So to avoid it i am using INADDR_ANY and bind it.
Now i need to get my local IP address to inform to the server. Is there any API which will tell me which IP address of the NIC is active?
You need to bind to an explicit IP address rather than INADDR_ANY as binding to INADDR_ANY will mean that calling getsockname() on the socket to get the local address will simply return INADDR_ANY.
So, what you need to do is iterate the available endpoints (using getaddrinfo()) and create a socket on each. These will then give you the correct address if you call getsockname() on them later.

Resources