ktor
This commit is contained in:
parent
2db0d6b20d
commit
31be601d72
|
|
@ -86,9 +86,8 @@ dependencies {
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
|
||||||
implementation 'io.ktor:ktor-server-core:2.3.4'
|
implementation 'io.ktor:ktor-server-core:2.3.4'
|
||||||
implementation 'io.ktor:ktor-server-netty:2.3.4'
|
implementation 'io.ktor:ktor-server-netty:2.3.4'
|
||||||
implementation 'io.ktor:ktor-client-content-negotiation:2.3.4'
|
|
||||||
implementation 'io.ktor:ktor-server-content-negotiation:2.3.4'
|
implementation 'io.ktor:ktor-server-call-logging:2.3.4'
|
||||||
implementation 'io.ktor:ktor-client-logging-jvm:2.3.4'
|
|
||||||
//implementation 'wang.harlon.quickjs:wrapper-java:1.0.0'
|
//implementation 'wang.harlon.quickjs:wrapper-java:1.0.0'
|
||||||
// implementation(ext: 'aar', name: 'quickjs', group: 'fongmi', version: 'release')
|
// implementation(ext: 'aar', name: 'quickjs', group: 'fongmi', version: 'release')
|
||||||
// api 'wang.harlon.quickjs:wrapper-android:2.0.0'
|
// api 'wang.harlon.quickjs:wrapper-android:2.0.0'
|
||||||
|
|
|
||||||
|
|
@ -79,3 +79,5 @@
|
||||||
-dontwarn org.eclipse.jetty.npn.NextProtoNego$ServerProvider
|
-dontwarn org.eclipse.jetty.npn.NextProtoNego$ServerProvider
|
||||||
-dontwarn org.eclipse.jetty.npn.NextProtoNego
|
-dontwarn org.eclipse.jetty.npn.NextProtoNego
|
||||||
-dontwarn reactor.blockhound.integration.BlockHoundIntegration
|
-dontwarn reactor.blockhound.integration.BlockHoundIntegration
|
||||||
|
-dontwarn org.slf4j**
|
||||||
|
-dontwarn org.slf4j.**
|
||||||
|
|
@ -8,8 +8,10 @@ import io.ktor.http.HttpHeaders
|
||||||
import io.ktor.http.HttpStatusCode
|
import io.ktor.http.HttpStatusCode
|
||||||
import io.ktor.server.application.ApplicationCall
|
import io.ktor.server.application.ApplicationCall
|
||||||
import io.ktor.server.application.call
|
import io.ktor.server.application.call
|
||||||
|
import io.ktor.server.application.install
|
||||||
import io.ktor.server.engine.embeddedServer
|
import io.ktor.server.engine.embeddedServer
|
||||||
import io.ktor.server.netty.Netty
|
import io.ktor.server.netty.Netty
|
||||||
|
import io.ktor.server.plugins.callloging.CallLogging
|
||||||
import io.ktor.server.response.respondBytesWriter
|
import io.ktor.server.response.respondBytesWriter
|
||||||
import io.ktor.server.response.respondText
|
import io.ktor.server.response.respondText
|
||||||
import io.ktor.server.routing.get
|
import io.ktor.server.routing.get
|
||||||
|
|
@ -32,6 +34,7 @@ object KtorServer {
|
||||||
private val partSize = 1024 * 1024 * 1
|
private val partSize = 1024 * 1024 * 1
|
||||||
private val server by lazy {
|
private val server by lazy {
|
||||||
embeddedServer(Netty, port) {
|
embeddedServer(Netty, port) {
|
||||||
|
install(CallLogging)
|
||||||
|
|
||||||
|
|
||||||
routing {
|
routing {
|
||||||
|
|
@ -107,7 +110,8 @@ object KtorServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解析范围请求
|
// 解析范围请求
|
||||||
val (startPoint, endPoint) = parseRangePoint(rangeHeader
|
val (startPoint, endPoint) = parseRangePoint(
|
||||||
|
rangeHeader
|
||||||
)
|
)
|
||||||
SpiderDebug.log("startPoint: $startPoint; endPoint: $endPoint")
|
SpiderDebug.log("startPoint: $startPoint; endPoint: $endPoint")
|
||||||
val contentLength = getContentLength(url, headers)
|
val contentLength = getContentLength(url, headers)
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
26a0a9482a83ef213e4e1222307b5258
|
dd6c6d1e9aa097c900a0769c1f181147
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://ghproxy.net/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;26a0a9482a83ef213e4e1222307b5258",
|
"spider": "https://ghproxy.net/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;dd6c6d1e9aa097c900a0769c1f181147",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "电视直播",
|
"name": "电视直播",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue