mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 09:00:28 +08:00
Removed Todo for protocol upgrade http server
This commit is contained in:
parent
e6fca61a59
commit
74dd2261c9
@ -73,39 +73,6 @@ public class WebServer {
|
||||
|
||||
if (!usingHttps) {
|
||||
server = HttpServer.create();
|
||||
return;
|
||||
// TODO Http Redirect Server
|
||||
// } else {
|
||||
// HttpServer protocolUpdateServer = HttpServer.create(new InetSocketAddress(port), 10);
|
||||
// protocolUpdateServer.setExecutor(Executors.newSingleThreadExecutor());
|
||||
//
|
||||
// protocolUpdateServer.createContext("/", new HttpHandler() {
|
||||
// @Override
|
||||
// public void handle(HttpExchange exchange) throws IOException {
|
||||
// try {
|
||||
// URI uri = exchange.getRequestURI();
|
||||
// Headers requestHeaders = exchange.getRequestHeaders();
|
||||
// List<String> host = requestHeaders.get("Host");
|
||||
// String currentAddress;
|
||||
// if (Verify.isEmpty(host)) {
|
||||
// currentAddress = HtmlUtils.getIP();
|
||||
// } else {
|
||||
// currentAddress = host.get(0);
|
||||
// }
|
||||
// Headers responseHeaders = exchange.getResponseHeaders();
|
||||
// String newAddress = "https://" + currentAddress + uri.toASCIIString();
|
||||
// responseHeaders.set("Location", newAddress);
|
||||
// Log.debug("Redirected http " + uri + " to new address: " + newAddress);
|
||||
// exchange.sendResponseHeaders(301, 0);
|
||||
// exchange.getResponseBody().close();
|
||||
// } finally {
|
||||
// exchange.close();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
// protocolUpdateServer.start();
|
||||
}
|
||||
|
||||
HttpContext context = server.createContext("/", new HttpHandler() {
|
||||
|
Loading…
Reference in New Issue
Block a user