This commit is contained in:
HapeLee
2025-06-04 13:33:51 +08:00
parent b86d90021c
commit 6c0757c91b
972 changed files with 6885 additions and 7321 deletions
@@ -0,0 +1,24 @@
package io.legato.kazusa.web
import fi.iki.elonen.NanoWSD
import io.legato.kazusa.service.WebService
import io.legato.kazusa.web.socket.*
class WebSocketServer(port: Int) : NanoWSD(port) {
override fun openWebSocket(handshake: IHTTPSession): WebSocket? {
WebService.serve()
return when (handshake.uri) {
"/bookSourceDebug" -> {
BookSourceDebugWebSocket(handshake)
}
"/rssSourceDebug" -> {
RssSourceDebugWebSocket(handshake)
}
"/searchBook" -> {
BookSearchWebSocket(handshake)
}
else -> null
}
}
}