httpserver
This commit is contained in:
parent
9fcf1455e8
commit
397b67a704
|
|
@ -86,8 +86,8 @@ dependencies {
|
||||||
|
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
|
||||||
// https://mvnrepository.com/artifact/com.sun.net.httpserver/http
|
// https://mvnrepository.com/artifact/com.sun.net.httpserver/http
|
||||||
implementation(files("libs/sun-common-server.jar"))
|
/* implementation(files("libs/sun-common-server.jar"))
|
||||||
implementation("com.sun.net.httpserver:http:20070405")
|
implementation("com.sun.net.httpserver:http:20070405")*/
|
||||||
// implementation("com.hibegin:simplewebserver:0.1.15")
|
// implementation("com.hibegin:simplewebserver:0.1.15")
|
||||||
//implementation("com.github.codeborne.klite:klite-server:1.7.0")
|
//implementation("com.github.codeborne.klite:klite-server:1.7.0")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,52 +45,11 @@
|
||||||
# This is generated automatically by the Android Gradle plugin.
|
# This is generated automatically by the Android Gradle plugin.
|
||||||
-dontwarn org.bouncycastle.jce.provider.BouncyCastleProvider
|
-dontwarn org.bouncycastle.jce.provider.BouncyCastleProvider
|
||||||
|
|
||||||
# Please add these rules to your existing keep rules in order to suppress warnings.
|
|
||||||
# This is generated automatically by the Android Gradle plugin.
|
|
||||||
-dontwarn sun.misc.Service
|
|
||||||
-dontwarn sun.misc.ServiceConfigurationError
|
|
||||||
-dontwarn sun.security.action.GetBooleanAction
|
|
||||||
-dontwarn sun.security.action.GetIntegerAction
|
|
||||||
-dontwarn sun.security.action.GetLongAction
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Logback (Custom rules, see https://github.com/krschultz/android-proguard-snippets/blob/master/libraries/proguard-logback-android.pro)
|
|
||||||
# to ignore warnings coming from slf4j and logback
|
|
||||||
|
|
||||||
# Please add these rules to your existing keep rules in order to suppress warnings.
|
|
||||||
# This is generated automatically by the Android Gradle plugin.
|
|
||||||
-dontwarn com.sun.net.httpserver.HttpContext
|
|
||||||
-dontwarn com.sun.net.httpserver.HttpHandler
|
|
||||||
-dontwarn com.sun.net.httpserver.HttpServer
|
|
||||||
-dontwarn java.lang.System$Logger$Level
|
|
||||||
-dontwarn java.lang.System$Logger
|
|
||||||
|
|
||||||
# Please add these rules to your existing keep rules in order to suppress warnings.
|
|
||||||
# This is generated automatically by the Android Gradle plugin.
|
|
||||||
# Please add these rules to your existing keep rules in order to suppress warnings.
|
|
||||||
# This is generated automatically by the Android Gradle plugin.
|
|
||||||
-dontwarn org.ietf.jgss.ChannelBinding
|
|
||||||
-dontwarn org.ietf.jgss.MessageProp
|
|
||||||
-dontwarn org.ietf.jgss.Oid
|
|
||||||
-dontwarn sun.reflect.CallerSensitive
|
|
||||||
-dontwarn sun.reflect.Reflection
|
|
||||||
# Please add these rules to your existing keep rules in order to suppress warnings.
|
|
||||||
# This is generated automatically by the Android Gradle plugin.
|
|
||||||
-dontwarn javax.security.auth.kerberos.KeyTab
|
|
||||||
-dontwarn sun.net.util.URLUtil
|
|
||||||
-dontwarn sun.net.www.ParseUtil
|
|
||||||
-dontwarn sun.nio.ByteBuffered
|
|
||||||
-dontwarn sun.nio.ch.Interruptible
|
|
||||||
-dontwarn sun.reflect.ConstantPool
|
|
||||||
-dontwarn sun.reflect.annotation.AnnotationType
|
|
||||||
-dontwarn sun.usagetracker.UsageTrackerClient
|
|
||||||
|
|
||||||
-keepattributes SourceFile,LineNumberTable
|
-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
-assumenosideeffects class org.slf4j.Logger{*;}
|
|
||||||
-keep class sun.misc.** { *; }
|
|
||||||
|
|
||||||
|
|
||||||
# 禁用代码混淆
|
# 禁用代码混淆
|
||||||
-dontobfuscate
|
#-dontobfuscate
|
||||||
|
|
@ -28,14 +28,14 @@ object ProxyServer {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
httpServer = AdvancedHttpServer(port)
|
httpServer = AdvancedHttpServer(port)
|
||||||
httpServer!!.addRoutes("/") { _, response ->
|
httpServer?.addRoutes("/") { _, response ->
|
||||||
run {
|
run {
|
||||||
response.setContentType("text/html")
|
response.setContentType("text/html")
|
||||||
response.start()
|
response.start()
|
||||||
response.write("Hello, world!")
|
response.write("Hello, world!")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
httpServer!!.addRoutes("/proxy") { req, response ->
|
httpServer?.addRoutes("/proxy") { req, response ->
|
||||||
run {
|
run {
|
||||||
val url = Util.base64Decode(req.queryParams["url"])
|
val url = Util.base64Decode(req.queryParams["url"])
|
||||||
val header: Map<String, String> = Gson().fromJson<Map<String, String>>(
|
val header: Map<String, String> = Gson().fromJson<Map<String, String>>(
|
||||||
|
|
@ -44,7 +44,7 @@ object ProxyServer {
|
||||||
proxyAsync(url, header, req, response)
|
proxyAsync(url, header, req, response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
httpServer!!.start()
|
httpServer?.start()
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
SpiderDebug.log("start server e:" + e.message)
|
SpiderDebug.log("start server e:" + e.message)
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
c1590ab280fefce3b7d9ebf4d8b029a5
|
4111cbdc5007a7e0510c84e4162e5ad9
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;c1590ab280fefce3b7d9ebf4d8b029a5",
|
"spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;4111cbdc5007a7e0510c84e4162e5ad9",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "电视直播",
|
"name": "电视直播",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue