Sockets: Only allow certain connections.
Posted: Mon Jul 31, 2006 7:40 pm
Is it possible to check the IP of who is trying to connect to a socket before the connection is actually accepted, and allow them to connect only if they have a specific IP? Using TCP.
Also: Is it possible to send data before or as the script connects, so that the data can be analyzed before the server decides to allow the connection or not? Using TCP.
Is it possible to read data sent from a UDP socket to a TCP socket? Is that even possible?
Basically, I have a "login" server, and I have "main" servers. There is one login server, and there can, but don't have to be, multiple "main" servers. I don't want the login server to accept client connections until at least one "main" server has connected to it. The point is so people can login with the login server, and then get forwarded to one of the "main" servers. The "main" servers all have to connect to the login server, but so do the clients. Right now the only way I have to authenticate the "main" servers when they connect is to accept all connections to the login server, and use the data that they send from there. Ideally, I would be able to reject all connections to the login server except for connections coming from "main" servers.
Thanks.
Also: Is it possible to send data before or as the script connects, so that the data can be analyzed before the server decides to allow the connection or not? Using TCP.
Is it possible to read data sent from a UDP socket to a TCP socket? Is that even possible?
Basically, I have a "login" server, and I have "main" servers. There is one login server, and there can, but don't have to be, multiple "main" servers. I don't want the login server to accept client connections until at least one "main" server has connected to it. The point is so people can login with the login server, and then get forwarded to one of the "main" servers. The "main" servers all have to connect to the login server, but so do the clients. Right now the only way I have to authenticate the "main" servers when they connect is to accept all connections to the login server, and use the data that they send from there. Ideally, I would be able to reject all connections to the login server except for connections coming from "main" servers.
Thanks.