mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-21 11:55:15 +01:00
ktor forwarded headers, etag, more complete logging
This commit is contained in:
parent
169125137d
commit
94cfd7fb1d
@ -9,6 +9,7 @@ plugins {
|
||||
|
||||
application {
|
||||
mainClassName = "com.github.creeper123123321.viaaas.VIAaaSKt"
|
||||
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=true")
|
||||
}
|
||||
|
||||
java {
|
||||
|
@ -16,14 +16,21 @@ import java.time.Duration
|
||||
class ViaWebApp {
|
||||
fun Application.main() {
|
||||
install(DefaultHeaders)
|
||||
install(ConditionalHeaders)
|
||||
install(CallLogging) {
|
||||
level = Level.INFO
|
||||
this.format {
|
||||
"${it.request.local.method.value} ${it.response.status()?.value} ${it.request.local.remoteHost} (O: ${it.request.origin.remoteHost}) " +
|
||||
"${it.request.local.scheme}://${it.request.local.host}:${it.request.local.port}${it.request.local.uri}"
|
||||
}
|
||||
}
|
||||
install(WebSockets) {
|
||||
maxFrameSize = Short.MAX_VALUE.toLong()
|
||||
pingPeriod = Duration.ofSeconds(60)
|
||||
timeout = Duration.ofSeconds(15)
|
||||
}
|
||||
install(XForwardedHeaderSupport)
|
||||
install(ForwardedHeaderSupport)
|
||||
|
||||
routing {
|
||||
webSocket("/ws") {
|
||||
|
@ -9,11 +9,11 @@ ktor {
|
||||
}
|
||||
|
||||
security {
|
||||
ssl {
|
||||
keyStore = config/https.jks
|
||||
keyAlias = mykey
|
||||
keyStorePassword = changeit
|
||||
privateKeyPassword = changeit
|
||||
}
|
||||
ssl {
|
||||
keyStore = config/https.jks
|
||||
keyAlias = mykey
|
||||
keyStorePassword = changeit
|
||||
privateKeyPassword = changeit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
#######################
|
||||
## CHANGING THIS CONFIG AT RUNTIME ISN'T SUPPORTED
|
||||
## See application.conf in resources for https interface options
|
||||
## See https://ktor.io/docs/configurations.html#command-line for https interface options
|
||||
# Port used for binding Minecraft port
|
||||
#######################
|
||||
port: 25565
|
||||
# Address to bind
|
||||
bind-address: localhost
|
||||
@ -37,4 +39,4 @@ rate-limit-ws: 1.5
|
||||
# Rate limits new front-end connections per second per ip. Will disconnect when hit
|
||||
rate-limit-connection-mc: 10.0
|
||||
# Limits how many usernames a websocket connection can listen to.
|
||||
listening-ws-limit: 10
|
||||
listening-ws-limit: 10
|
Loading…
Reference in New Issue
Block a user