阅读背景:

如何仅使用localhost(Java)中的套接字接受连接?

来源:互联网 

I have a java app (not running in any application container) which listens on a ServerSocket for connections. I would like it to only accept connections which come from localhost. Currently, after a connection is accepted, it checks the peer IP and rejects it if it is not the loopback address, but I know that peer IP addresses can be spoofed. So, if possible, I'd prefer to bind to a socket that only listens on the loopback interface; is this possible?I have a java app (not running in any applicati




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: