How do I trace my friends IP address while chating (in facebook,gmail ) ?
Can we do this in jquery ?
Please let me know your pointers.
Thanks,
-Pravin
No you cannot because your javascript chat application does not communicate directly with your friend's browser. It all goes through the server side chat application (gmail, fb... etc) so you are only communicating with that IP which communicates with all the rest.
Of course the server side chat application could be somehow revealing the chat participants IP addresses but this is highly unlikely in any web based chat application that it's used in production right now.
The easiest way to find out the IP of a chat participant is to make him/her click on link for which you'll be monitoring http traffic. I hope it's for a good reason :)
I do not think it is possible since you both connected to the chatting server and all information go through them and there are no direct link between you and your friend.
You can't from a browser. The chat protocol is implemented on the server side, and your browser doesn't know the IP address of your correspondant.
As others have said, you can't do this directly. The only way around it then is to give your friend a link to a script on your server that then alerts you of the IP address.
Basically, such a script would check the remote address, and then log it somewhere or e-mail it to you. That script might then return an image or redirect somewhere so that the person you sent the link to isn't so aware of what happened.
You should also know that the remote address isn't necessarily the IP of your friend. It could be a proxy server, or something else getting in the way. It's more common than you might think.
Related
I've looked at the existing questions/responses in StackOverFlow and there were no working answers so I'm posting this question. Our website is an C# MVC site that uses Javascript for validation etc.
The scenario is this:
We want to display a message in our external website to users (employees) who are actually accessing it from within our office network. The message would remain hidden for users who are outside our network (general public).
Please note that an internal office user is going out to the internet and hitting our external website so they would have a public IP address (not their local network IP) and I can't rely on that public IP address remaining consistent so I can't use the IP as the determining factor.
I would think that this would require a client-side solution but I've looked into JS possible solutions and none have worked.
Can anyone think of a way to determine if the user visiting out external website is an employee or part of the general public?
I don't have enough reputation to comment, however putting anything inside a JS file would still be visible if someone was to inspect it in their browser since it's essentially downloaded when the client browses the site. Just ensure nothing sensitive is added to the message such as a link to an employee only portal, as you'll expose the URL for potential attacks.
You could set up a 'beacon' on a machine in your local network. It would connect to your web server every 5 seconds, and inform your web server of the dynamic IP address that your office network is currently being assigned by your ISP to access the external internet.
Now, your web server knows which IP address to display the special message to.
Note that you will need to check that your office internet service provider is not using Carrier-Grade NAT. This will cause an issue, because a member of the public might be assigned an originating IP address that is the same as one used by people on your office network.
Another approach would be to set up a proxy server inside your local network, which would inject a special header into outgoing requests to your public web server if it sees that the request originates internally. You would configure your office router to force all web traffic through this proxy. The proxy would need to have a valid HTTPS certificate for the web server's domain name, so that is able to alter HTTPS traffic.
Thanks everyone for your suggestions. I ended up going a slightly different route which I has seen suggested in another post on another website I believe...I just didn't know if it would work but it does seem to work.
I put a reference to a .JS file that sits on one of our internal network servers . That JS changes the display value for the message I want do display which is initially hidden. So for the general public the message remains hidden, but for anyone on our network it will unhide the message.
I have a nodejs app, which I made for my client, I want to show him his website on his machine (we live at different sides of the globe) Is there any way it is possible?
This is a pretty long winded question. There are a couple different solutions to this.
1: You could host a server locally and then open up some firewall ports to allow traffic to route information from your IP address on port 80 or 443 to your application. This is pretty risky though and would need to be secured on your end to prevent intrusion. This would also mean that anytime your IP changes from the ISP you would either need to update the customer with the new IP or use a domain name that is being updated with something like dyndns.. Here's a link for some info on that route.
https://blog.resellerclub.com/how-to-host-a-domain-website-on-your-own/
2: You could use a hosting company like AWS, Azure, or any VPS based hosting solution. This can sometimes cost money and take some time to setup but long term this is a great solution as long as you are willing to put forth the time and effort to learn whatever tech stack you choose. Here's a link to some info on this route with AWS
https://aws.amazon.com/getting-started/hands-on/deploy-nodejs-web-app/
I have built a websocket in C++ (using boost::beast).
It is going to serve a website (client) with a JSON string if requested.
When designing my setup I made a disastrous mistake: I forgot that the client web browser (that is running on a separate device from the server) will not know the IP address of the server. It will know the port that the server is listening on.
I should specify: Both (server and client) are running in a local network.
So I have two clumsy ideas to resolve this. I would be very happy to hear your input – I am sure there will be a more elegant way to fix my problem.
Send some kind of broadcast message “Very specific string” into the network. My server will know that it is been looked for and will respond with its IP, so that the connection can be established.
This post seems to indicate that this approach will not be possible.
Have the user input the (known) IP address of the device that is running the server. I would really like to avoid this last resort solution.
Unfortunately, I cannot run node.js on the device that is hosting the websocket server.
I might not be understanding the problem. Why aren't you capable of knowing the IP of the server? Is it due because it changes? Is it because it's a server you don't know?
Maybe the solution is not about finding the IP rather than knowing beforehand the server IP address.
I could recommend checking out this post to find out the IP address in your local network. If you at least know the servername of the server that could be helpful.
#E.Soria
Thank you for your answer! I was not precise enough.
The problem was, that the server is running on a device that is going to be part of our customer’s network. The customer will define the IP address for the device, which means that I need some way of getting the address of the server.
But I might have found another solution (as you might already be able to tell I am very new to networking, so this just may be wrong): I will host the website on the same device that is hosting the server and supplying the data. Then I can just establish a websocket connection through javascript like this: let socket = new WebSocket(ws://127.0.0.1:8080); and have the website read data from the server. This seems to be very straightforward and I am a little embarrassed that I did not think of this before.
I just had not really understood how the internet works :) As long as the user who wants to see the website knows where it is hosted, he/she can just connect to the website and will see anything that I put on there.
So I currently have a node.js app that reads my website user ips from a file and using geoip places a dot in a map for each visitor location.
Problem is, everytime a new visitor comes the message sent through the websocket can be seen by the client if he inspects traffic with wireshark or fiddler.
Obviously displaying user ips is out of the question, so I am wondering if using TLS would be enough to make this information unreadable or impossible to debug from the javascript code.
Thanks
The information is sent to the user's browser. The browser must be able to decode it to be able to work with it. The browser also incidentally offers debugging tools which allow the user to inspect everything that's going on. Ergo, the user is able to inspect anything and everything that the browser can. No, what you want is not possible. If the information is confidential, never send it to any client in the first place.
It will make it more-or-less impossible to sniff the data in transit.
It does nothing to stop people taking your JS and tweaking it slightly to log the data after the browser has received it.
You can't hide data you send to the browser from the person who controls the browser.
The biggest question is why are you sending the IP and the position to the browser? To place the marker on the map, you just need the position.
If you need to distinct the users by IP address on the client side, you could write an own hashing algorithm which concats the ip with a predefined string(secret). So the identifier is always the same for the same IP, but the IP is not reconstructable without the corresponding secret.
TLS helps against traffic snipping by 3rd party attackers. If normal users can access sensitive information, then TLS worths nothing. It is called Transport Layer Security for a good reason.
Greetings all,
I would very much like to determine the IP# of a domain from client script.
It's for use in a testing application to determine whether or not a certain domain is set to a QA address as opposed to the address live on the . The testing machine will have it's host file set to resolve a domain to the QA address.
Pinging from the server won't help since the server is getting the public DNS address.
Is this possible in JavaScript? Maybe a Flash could do the trick?
Have a look at Smart IP Api. Seems to do everything you're looking for and has some simple tutorials.