Limiting connections from localhost only?

  • Thread starter Thread starter MrNobody
  • Start date Start date
MrNobody said:
Hi, I'm using Sockets classes from this web site:
http://www.adp-gmbh.ch/win/misc/sockets.html

to create a very simple server

Is it possible to limit connections to my server to localhost only? (so
not
accept any remote connections)

What would I have to do?

Find the code that handles incoming connections and make sure the IP address
is 127.0.0.1. If it is, refuse the connection. You may possibly need to
also check the A name in some cases which would be anything other than
localhost.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
 
MrNobody said:
Hi, I'm using Sockets classes from this web site:
http://www.adp-gmbh.ch/win/misc/sockets.html

to create a very simple server

Is it possible to limit connections to my server to localhost only? (so not
accept any remote connections)

What would I have to do?
alternatively, when you create the server socket, bind it to 127.0.0.1 rather
than INADDR_ANY. That way, it isn't even seen by the outside!

/steveA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top