* created pwa
* fixed jdbc warning * new gradle run task * new gradle jar-build task
This commit is contained in:
@@ -23,12 +23,13 @@ public class Webserver {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
server.createContext("/", new MainPage());
|
||||
|
||||
server.createContext("/senddata/loginget", new LoginRequest());
|
||||
server.createContext("/senddata/registerpost",new RegisterRequest());
|
||||
server.createContext("/senddata/checkloginstate",new CheckLoginState());
|
||||
server.createContext("/senddata/wastedata",new DataRequest());
|
||||
server.createContext("/senddata/registerpost", new RegisterRequest());
|
||||
server.createContext("/senddata/checkloginstate", new CheckLoginState());
|
||||
server.createContext("/senddata/wastedata", new DataRequest());
|
||||
server.createContext("/senddata/admindata", new AdminRequests());
|
||||
server.createContext("/senddata/newdate", new NewDateRequest());
|
||||
|
||||
@@ -36,5 +37,63 @@ public class Webserver {
|
||||
server.start();
|
||||
Log.info("Server available at http://127.0.0.1:8000 now");
|
||||
|
||||
/*
|
||||
|
||||
try {
|
||||
server = HttpsServer.create(new InetSocketAddress(8000), 0);
|
||||
|
||||
// initialise the HTTPS server
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
|
||||
// initialise the keystore
|
||||
char[] password = "password".toCharArray();
|
||||
KeyStore ks = KeyStore.getInstance("JKS");
|
||||
FileInputStream fis = new FileInputStream("testkey.jks");
|
||||
ks.load(fis, password);
|
||||
|
||||
// setup the key manager factory
|
||||
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
|
||||
kmf.init(ks, password);
|
||||
|
||||
// setup the trust manager factory
|
||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
|
||||
tmf.init(ks);
|
||||
|
||||
// setup the HTTPS context and parameters
|
||||
sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
|
||||
server.setHttpsConfigurator(new HttpsConfigurator(sslContext) {
|
||||
public void configure(HttpsParameters params) {
|
||||
try {
|
||||
// initialise the SSL context
|
||||
SSLContext context = getSSLContext();
|
||||
SSLEngine engine = context.createSSLEngine();
|
||||
params.setNeedClientAuth(false);
|
||||
params.setCipherSuites(engine.getEnabledCipherSuites());
|
||||
params.setProtocols(engine.getEnabledProtocols());
|
||||
|
||||
// Set the SSL parameters
|
||||
SSLParameters sslParameters = context.getSupportedSSLParameters();
|
||||
params.setSSLParameters(sslParameters);
|
||||
|
||||
} catch (Exception ex) {
|
||||
System.out.println("Failed to create HTTPS port");
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (CertificateException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (UnrecoverableKeyException e) {
|
||||
e.printStackTrace();
|
||||
} catch (KeyStoreException e) {
|
||||
e.printStackTrace();
|
||||
} catch (KeyManagementException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user