diff --git a/app/src/main/java/io/legado/app/web/WebSocketServer.kt b/app/src/main/java/io/legado/app/web/WebSocketServer.kt new file mode 100644 index 000000000..c885a1e0a --- /dev/null +++ b/app/src/main/java/io/legado/app/web/WebSocketServer.kt @@ -0,0 +1,13 @@ +package io.legado.app.web + +import fi.iki.elonen.NanoWSD +import io.legado.app.web.controller.SourceDebugWebSocket + +class WebSocketServer(port: Int) : NanoWSD(port) { + + override fun openWebSocket(handshake: IHTTPSession): WebSocket? { + return if (handshake.uri == "/sourceDebug") { + SourceDebugWebSocket(handshake) + } else null + } +}