httpserver

This commit is contained in:
lushunming 2025-07-22 14:06:44 +08:00
parent e18a721e44
commit a7485e82ae
4 changed files with 18 additions and 6 deletions

View File

@ -41,9 +41,15 @@ object ProxyServer {
val headers = req.queryParams["headers"]; val headers = req.queryParams["headers"];
SpiderDebug.log("url: $url") SpiderDebug.log("url: $url")
SpiderDebug.log("headers: $headers") SpiderDebug.log("headers: $headers")
url = Util.base64Decode(url) url = String(
org.apache.commons.codec.binary.Base64().decode(url),
Charset.forName("UTF-8")
)
val header: Map<String, String> = Gson().fromJson<Map<String, String>>( val header: Map<String, String> = Gson().fromJson<Map<String, String>>(
Util.base64Decode(headers), MutableMap::class.java String(
org.apache.commons.codec.binary.Base64().decode(headers),
Charset.forName("UTF-8")
), MutableMap::class.java
) )
proxyAsync(url, header, req, response) proxyAsync(url, header, req, response)
} }
@ -218,12 +224,18 @@ object ProxyServer {
} }
fun buildProxyUrl(url: String, headers: Map<String, String>): String { fun buildProxyUrl(url: String, headers: Map<String, String>): String {
return "http://127.0.0.1:$port/proxy?url=${Util.base64Encode(url.toByteArray(Charset.defaultCharset()))}&headers=${
Util.base64Encode( return "http://127.0.0.1:$port/proxy?url=${
org.apache.commons.codec.binary.Base64()
.encodeToString(url.toByteArray(Charset.defaultCharset()))
}&headers=${
org.apache.commons.codec.binary.Base64().encodeToString(
Json.toJson(headers).toByteArray( Json.toJson(headers).toByteArray(
Charset.defaultCharset() Charset.defaultCharset()
) )
) )
}" }"
} }

Binary file not shown.

View File

@ -1 +1 @@
a7ec699dbb3c9e127e1d1781660263f7 49fdf9b1a3b560514c13c8ab835de5d7

View File

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