Sub Process_Globals
Public srvr As Server
Public srvrssl As Server
Public rdcConnector1 As RDCConnector
Public const VERSION As Float = 2.22
Type DBCommand (Name As String, Parameters() As Object)
Type DBResult (Tag As Object, Columns As Map, Rows As List)
End Sub
Sub AppStart (Args() As String)
'Dim config As Map = rdcConnector1.LoadConfigMap
'#If RELEASE
'ConfigureSSL(config.Get("SSLPort"))
' #End If
srvr.Initialize("")
ConfigureSSL(rdcConnector1.serverSSLPort)
rdcConnector1.Initialize
srvr.Port = rdcConnector1.serverPort
srvr.AddHandler("/test", "TestHandler", False)
srvr.AddHandler("/rdc", "RDCHandler", False)
srvr.Start
srvrssl.Port = rdcConnector1.serverSSLPort
srvrssl.AddHandler("/test", "TestHandler", False)
srvrssl.AddHandler("/rdc", "RDCHandler", False)
srvrssl.Start
Log($"jRDC is running (version = $1.2{VERSION})"$)
StartMessageLoop
End Sub
Private Sub ConfigureSSL (SslPort As Int)
Dim ssl As SslConfiguration
ssl.Initialize
ssl.SetKeyStorePath("/etc/letsencrypt/live/website.com", "keystore.jks") 'path to keystore file
ssl.KeyStorePassword = "scoobydoo"
ssl.KeyManagerPassword = "scoobydoo"
srvr.SetSslConfiguration(ssl, SslPort)
'add filter to redirect all traffic from http to https (optional)
srvr.AddFilter("/*", "HttpsFilter", False)
End Sub