My simple java HTTPS server only works for localhost

前端 未结 1 1637
遇见更好的自我
遇见更好的自我 2021-02-06 17:55

I have a simple HTTPS test server implemented in Java, as shown below. It accepts client connections and sends back a piece of text about the socket. The problem is that it work

1条回答
  •  别跟我提以往
    2021-02-06 18:11

    Try creating your server socket like this:

    SSLServerSocket s = (SSLServerSocket) ssf.createServerSocket(8888, 0, null);
    

    The null as the last argument should tell the server socket factory to create a socket that is bound to all network interfaces.

    Here's a link to the javadoc for that particular version of the method.

    0 讨论(0)
提交回复
热议问题