Mercurial Hosting > luan
diff src/luan/webserver/Server.java @ 1175:d6d0bd05ad8c
exit on bind conflict, serve "127.0.0.1" for serve_for_nginx
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 12 Feb 2018 14:55:28 -0700 |
parents | 0f59eab45f3d |
children | 79b1e9ffd0c0 |
line wrap: on
line diff
--- a/src/luan/webserver/Server.java Sun Feb 11 17:13:40 2018 -0700 +++ b/src/luan/webserver/Server.java Mon Feb 12 14:55:28 2018 -0700 @@ -3,6 +3,7 @@ import java.io.IOException; import java.net.Socket; import java.net.ServerSocket; +import java.net.InetAddress; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; @@ -57,4 +58,13 @@ } } + public static class Local extends Server { + public Local(int port,Handler handler) { + super(port,handler); + } + + protected ServerSocket newServerSocket() throws IOException { + return new ServerSocket(port,0,InetAddress.getByName("127.0.0.1")); + } + } }