Sub AppStart (Args() As String)
srvr.Initialize("srvr")
srvr.AddWebSocket("/ws", "leaflet")
srvr.AddHandler("/tableHelper", "TableHelper", False)
srvr.Port = 10001
ConfigureSSL(10002)
srvr.Start
StartMessageLoop
End Sub
Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean
If req.Secure Then
Return True
Else
resp.SendRedirect(req.FullRequestURI.Replace("http:", "https:") _
.Replace(srvr.Port, srvr.SslPort))
Return False
End If
End Sub
Private Sub ConfigureSSL (SslPort As Int)
Dim ssl As SslConfiguration
ssl.Initialize
Log (File.DirApp)
ssl.SetKeyStorePath(File.DirApp, "/www/certs/lev.jsb.mybluehost.me.jks") 'path to keystore file
ssl.KeyStorePassword = "123456"
ssl.KeyManagerPassword = "123456"
srvr.SetSslConfiguration(ssl, SslPort)
srvr.AddFilter("/*", "HttpsFilter", False)
End Sub