json问题

This commit is contained in:
lushunming 2025-07-22 16:18:17 +08:00
parent 01b7fbb09d
commit d3ac6bd080
4 changed files with 11 additions and 15 deletions

View File

@ -19,6 +19,7 @@ object ProxyServer {
private var httpServer: AdvancedHttpServer? = null private var httpServer: AdvancedHttpServer? = null
private val infos = mutableMapOf<String, MutableMap<String, MutableList<String>>>(); private val infos = mutableMapOf<String, MutableMap<String, MutableList<String>>>();
fun stop() { fun stop() {
httpServer?.stop() httpServer?.stop()
} }
@ -163,7 +164,7 @@ object ProxyServer {
response.write("proxyAsync error: ${e.message}") response.write("proxyAsync error: ${e.message}")
} finally { } finally {
// channels.forEach { it.close() } // channels.forEach { it.close() }
} }
} }
@ -224,19 +225,14 @@ object ProxyServer {
} }
fun buildProxyUrl(url: String, headers: Map<String, String>): String { fun buildProxyUrl(url: String, headers: Map<String, String>): String {
val urlBase64 = org.apache.commons.codec.binary.Base64()
return "http://127.0.0.1:$port/proxy?url=${ .encodeToString(url.toByteArray(Charset.defaultCharset()))
org.apache.commons.codec.binary.Base64() val headerBase64 = org.apache.commons.codec.binary.Base64().encodeToString(
.encodeToString(url.toByteArray(Charset.defaultCharset())) Json.toJson(headers).toByteArray(
}&headers=${ Charset.defaultCharset()
org.apache.commons.codec.binary.Base64().encodeToString(
Json.toJson(headers).toByteArray(
Charset.defaultCharset()
)
) )
)
return "http://127.0.0.1:$port/proxy?key=$urlBase64&headers=$headerBase64"
}"
} }

Binary file not shown.

View File

@ -1 +1 @@
d1cf6ff4615de0bbbb26d7fb8148f0df 25dcdf484e1860fdd348f1585cee636a

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;d1cf6ff4615de0bbbb26d7fb8148f0df", "spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;25dcdf484e1860fdd348f1585cee636a",
"lives": [ "lives": [
{ {
"name": "电视直播", "name": "电视直播",