I'm looking for a service that would allow me to connect 2 computers with dynamics IPs.
There is the use case of the ideal service:
Client A wants to exchange with Client B using S server, with a known IP.
B connects to S and gives its current IP (global or local) and a UID
S stores B's IP and B's UID
A connects to S and ask for IP of B client using its UID (known)
S looks for UID and return B's IP
A receives B's IP
I need that because I don't know the computers' IP defore run time.
Do you know something that would solve this ? Ideally, it would work simply with my java client-server I'm curently developing, where the server should be found by the client.
Thank you in advance.
The scenario you are describing is exactly how Teamviewer remote control service is working. This way, you circumvent any NAT or firewall issues - neither A nor B need to open ports for forwarding, both connections are outward. See www.teamviewer.de for more details (note: no affiliation to this company, just a user).
Related
I'm setting up a tool that relays and verifies information. One of it's protocols though is to verify if the server trying to challenge a key is whitelisted.
Problem now is server 1 and 2 is in the same network. When I make server 1 connect to (somedomain.com), which is routed back to server 2. Server 2 recognizes remote address as the (local ip) not the public IP. (Even if I explicitly ask server 1 to connect using IP instead of Domain name.)
This creates problems as (Long story) but server 2 needs to recognize server 1's public IP and not Internal IP.
Would appreciate any help or tips I can get from this.
Cheers,
Jet
You can route traffic via external server using SSH or proxy.
I have a server running on my machine. I want to send a request to the server using different IP address to test a web application. I only have the machine on which the server is installed. I have been testing as a single user but now I would like to let the server think that the request is coming from a different ip address even though it is from the same machine. How can I do that?
Here are the 2 solutions that might be possible in your situation
1- To change the ip address :
Pick an ip from the free proxies here: http://www.freeproxylists.net/
And enter the info in firefox just like this page says:
http://www.wikihow.com/Enter-Proxy-Settings-in-Firefox
Note: You may pick a proxy with port 80.
Then you are good to go...
2- Or you might use a Virtual Machine installed on the same computer as the server and access the website right from it but beware not to use bridged connection.
For an iOS app I am developing, I want multiple phone to connect to each other and be able to voice chat between those devices.
I have it working when both devices are on the same network. This was quite simple and most of the stuff I want to do, is possible.
But now I am adding internet support, which is quite a hassle. I'll first try to explain how I want to match the devices, using a small webservice I set up.
Server
Start a new GameKit session, with session-mode GKSessionModePeer
Find the "Peer ID" of the server on the session I just created
Create a new CFSocketRef on an free port and keep it ready to accept connections
Send Peer ID and Port number to my webservice, running on an external server.
WebService
Webservice receives the information and stores it together with an ID and the IP address of the client in a database.
Send ID back to Server, which displays the ID
Client
When the user chooses to use the "Online" feature of GameKit to search for games, I ask the user for an ID (where the user should input the ID the server receives).
Client connects to the webservice supplying the ID. The webservice returns the information about the session (IP, PORT, Peer ID) of the server.
The user tries to connect to the IP address, with the port information and set up an input and output stream with the server.
This does not work ofcourse, because my network does not allow incoming connections and a random port (from an external network).
But now the question is, how do I solve this? I want to be able to set up a peer to peer connection between 2 devices, those devices could be on the same network, but also on separate networks.
Is there a framework, example or anything showing how to do this? I want to be able to send data from device to device, without sending it to a server first.
I'm not aware of any frameworks that do this. I do however have a lot of experience with p2p networking across multiple networks.
One important rule I learned: when communicating between networks, don't create a direct connection unless necessary. There are just too many factors that can (will?) cause issues, such as firewalls, NATs, etc.
Sure, you can let the connection try first. You can try to connect to the given IP addresses*, but in most cases it will fail. Even when using UPnP and NAT-PMP, you'll find that in a lot of cases (more than half?) you won't be able to accept incoming connections at all.
So make sure to have a backup plan. Make a network layer abstraction that doesn't only listen(), but also connects to a server. That way, when you can't connect to the IPs* of the client, you simply setup a connection via the server and the network abstraction takes care of it all.
Let me reiterate the above: don't rely on incoming connections only, always have a backup plan.
* I write IPs because clients can have multiple local/remote IPs. Always iterate over all these IPs when connecting. Example: my phone has 2 local IPv4 addresses (10.0.0.172 and 10.8.0.2), and an IPv6 address ([2001:x:x::6]). Of these three addresses, only the IPv6 address is publicly reachable, and the two IPv4 addresses are on different subnets so whether you can connect to them depends on the subnet that the other client is on. Always try to connect to both, and fall back to a server-proxied connection when it fails.
** I mentioned IPv6, yes. Let's not forget that IPv6 is not limited by NATs, unlike IPv4, and this means that you're far more likely to get a good connection via IPv6 than IPv4, if supported.
Has anyone tried to tunnel a WCF request from PC A to PC C via PC B?
In my case, PC A doesn't have direct access to PC C but PC A and PC C has access to PC B.
I Googled a bit and found that WCF doesn't support SOCKS proxies, otherwise this would have been resolved long ago.
Can anyone think of a way to tunnel WCF requests? I have been thinking of writing a WCF router but the problem is that I am not sure how to get the router address and the actual destination address in my WCF request. In other words, when I create a WCF proxy I can only set it to point to the router's address but how will the router know to which destination to route to? I could later have a PC D, E and F and I want to be able to select one of them.
If anyone knows of a method, tool, etc. Please let me know.
EDIT: Redefined my question due to people not completely understanding my problem.
Thanks
You can simply add a hostname record to each PC's hosts file.
For instance, on PC A you can add a hostname record "pc-b" that points to the IP address of PC B, and vice versa.
On PC A, add:
192.168.2.1 pc-b
(assuming the IP address is the one above), and on PC B, add:
192.168.2.2 pc-b
(again assuming this is the right IP address of course).
Then each PC can contact the other by the hostname, and they will not try to look up these hostnames via DNS.
The Azure Service Bus is related to WCF and has a sample project called Port Bridge that may solve your issue.
Check the solution out here: https://softwareengineering.stackexchange.com/questions/9652/what-are-some-interesting-uses-of-the-azure-service-bus/9656#9656
In order to notify all computers within the same LAN about my existence, I want to broadcast my hostname and IP address.
How do I go about doing so without sending them as a string?
Avik, this is what DNS is meant to be used for. While "regular" DNS is meant to hold names and IP addresses for each machine (statically configured), there is a dynamic DNS protocol which allows machines to update their DNS entries in real time.
This sort of capability is used in some of the office environments for my clients where printers on a machine are shared but the machines they're attached to use DHCP (meaning their IP address can change).
See here and here for details and the Windows implementation with DHCP.
Lets call your machine that wants to advertise itself the SERVER and all the machines that can use it, the CLIENTS.
Of course, dynamic DNS only notifies DNS itself of the name/IP mapping and is useful if the CLIENTS are already aware of your SERVER so they can get the IP address from DNS. If you have no way for CLIENTS to discover that your SERVER has just been added, you'll still need to broadcast a packet occasionally indicating that your SERVER exists (this will only need the SERVER name since CLIENTS will use DNS to get the IP address).
This broadcast packet should be picked up by all CLIENTS and kept in a local table. If the communications from a CLIENT to your SERVER fails, the local table entry for your SERVER should be removed (it'll be re-added when your SERVER broadcasts again).
Basically re-inventing NetBIOS or ZeroConf, as popular with small embedded devices for discovery by a Windows or OS X based installer or setup utility.
You can try to use UPnP Discovery.