get some info of client computer

Im using TIdTCPServer in server application and TIdTCPClient in client application to communicate via internet.
when client connected to server, I can get client remote IP only.

Can I get local ip or computer name of client from server ?
Who is Participating?
TheRealLokiConnect With a Mentor Senior DeveloperCommented:
The only info you can get from teh client connection is the ip and port
will give you the client's ip address
will give you te port it is using

But to get the computer name or it's local ip (in it's lan, instead of the router's ip) over the internet, the client will have to send it to you
IdTCPClient1.IOHandler.WriteLN('hi, my pc name is "bob" and my lan ip is "x.x.x.x"');
lhquangAuthor Commented:
because someone can make new client and send command to my server, someone can send bad lan ip,bad computer name too.

my purpose : limit the connection ( from one computer to my server) to 1.

if that computer run more than one client, only one client can connect, my server will disconnect other client.

I cannot count base on internet IP address because if that computer belonged to LAN with many computers use one internet IP address.

this is an old issue and is generally found in "clone-detection" schematics. the best solution for this at this point is to have another system that creates users and in that system you can implement as many restrictions as you want (or can, considering the limitations of the tehnology used). then, that user will be used by the client upon connecting. it is not 100% efficient, maybe not even 90%, but it's one of the best ways to stop clone connections considering that you can't control the making of the client software.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

lhquangAuthor Commented:
I want to make out public chat without creating account, so there is no way to limit ? T_T
not unless you explicitly ask in the chat protocol that the client must send out some identification that must be computed from some system information like:
- netcard MAC
- maybe other irrelevant stuff
you can verify at a rate of 80% that the received MAC is a valid network card MAC or a router MAC (there are, or at least were a few years back when I was searching for such stuff) public lists with manufacturer and their codes and product codes (you will have to decode the MAC for that))
- if the client doesn't send out a valid MAC you just close the connection. if it's a router mac then somebody is trying to trick you (remember, the client sends out the AMC of it's own network card ;) )
you might also ask for some info already found in the MAC address just to make sure that someone is not trying to trick you. but even so, the chanes are not higher than 98% in accuracy of clone detection.
TheRealLokiSenior DeveloperCommented:
I agree, I don't think it's possible to do what you want.
You will have to rely on a "login" system, and/or a limit per user, rather than connection
that way, if someone gets a user login, they can still only logon once, no matter how many machines they have.
If however, you do want them to be able to log on with 2+ machines in their cyber cafe (for example) they would have to use a different login for each computer.
lhquangAuthor Commented:
yes, some can make may accounts and login  many accounts.

I just want to limit connection in one computer.

and there is no way.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.