WAN IP in C++

Started by
26 comments, last by s134k 16 years, 10 months ago
Quote:Original post by Renegadeandy
So stop the stupid replys and more of the useful one like 2 posts back!


Aside from your own posts, I've only seen 1 at-all-"stupid" reply. And even that was a sardonic reply to this bit of biting-the-hand-that-feeds:

Quote:Original post by Renegadeandy
I need it for a support bit of software - i must have there WAN IP , however thats not the point you dont need to know *WHY* , just somebody please tell me *HOW*!


You've presupposed that getting the WAN IP of your host is the only possible solution to the problem you're trying to solve. A smart programmer realizes there are often many solutions of varying quality, and by exposing the *WHY*, he won't write off any -- quite possibly better -- alternatives.

Given that a WAN IP alone is worthless (for reasons Antheus was then kind enough to list, even after your snapping at him), it follows that you almost certainly wanted either an alternative you've not considered, or something more than just the WAN IP address. Answering *WHY* fills us in enough to be able to help with *EITHER*.

Since Antheus seems to have managed to goad the answer out of you for this thread, this is mainly just meant as advice for future posts -- pointing out why answering *WHY?* is usually a good idea. It'll also prevent some "stupid" replies from happening in the first place. Win-win situation!
Advertisement
Ok.

Points taken on board thanks for the advice.

Perhaps as i suggested above an easier way to do this is to create a bit of code which will generate a remote assistance ticket - building upon the software already in place by microsoft. If this can be done - I can then send that to a server via ftp for example - And i can then download and deal with the ticket.

Seem ok?
In desperate need for ideas guys! Can anybody help me through this?
I did this just yesterday.

I used TightVNC.

I put a button in the clients program which runs the vnc server and tells it to connect to my PC (cause I know my internet IP, which is dynamic so I use DynDNS.com). It does this through the connect switch -connect <your ip here>

On my PC I have the VNC viewer in listen mode.

So when they press the button, their server runs, connects to my listener and I'm connected to their PC.

PS I'm pretty sure it goes through firewalls and I dont think there is a way to generate a Remote Assistance invitation. Well I couldnt find out how anyway.
But didnt you need vnc to be installed on their pc first , by them!

I am trying to avoid them having to do that and set that up.

Can you go into more detail if the answer is No to above, cos this sounds perfect!
No, you just wack the WinVNC.exe file (the server) and maybe VNCHooks.dll in a folder where your program can run it.
Hmm ok - but then how the hell will i get their external IP on the fly!
Well you dont need to if you're only trying to connect to them with VNC.

They actually connect to you. So all you need is your IP. If your IP is dynamic then you can use a service like www.dyndns.com which gives you a static address pointing to your IP. I set my router to auto update dyndns as well so it should always point to my IP.
But if they are server, how the hell do they connect to u - surely thats the wrong way round - cos ur then running the VNC client, the client connects to the server doesnt it?
Yes I know its confusing. I didnt know it could do it either but I found out it can.

You see you put the VNC Viewer in listening mode on your PC. So the Viewer is listening for a server to connect to. Then when the person you're trying to help runs their server with the command -connect <your ip here> (or they click the button you make that does this automatically ;) it tells the server to connect to your viewer.

So yeah the VNC Server they run can connect to your VNC Viewer.

This topic is closed to new replies.

Advertisement