Skip to content

Commit

Permalink
fix trojan odor desProtocol
Browse files Browse the repository at this point in the history
  • Loading branch information
selcarpa committed Jun 23, 2023
1 parent 767d71a commit c0349de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ plugins {
}

group = "one.tain"
version = "1.9-SNAPSHOT"
version = "1.10-SNAPSHOT"

repositories {
mavenCentral()
}

dependencies {
implementation("io.netty:netty-all:4.1.93.Final")
// implementation("io.jpower.kcp:kcp-netty:1.5.0")
implementation("io.jpower.kcp:kcp-netty:1.5.0")

//ssl server support
implementation("org.bouncycastle:bcpkix-jdk18on:1.75")
Expand Down
22 changes: 11 additions & 11 deletions src/main/kotlin/protocol/Trojan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ class TrojanInboundHandler(private val inbound: Inbound) : SimpleChannelInboundH
originCTX.channel().id().asShortText()
}], addr: ${trojanPackage.request.host}:${trojanPackage.request.port}"
)
resolveOutbound(inbound).ifPresent { outbound ->
val odor = Odor(
host = trojanPackage.request.host,
port = trojanPackage.request.port,
originProtocol = Protocol.TROJAN,
desProtocol = if (Socks5CommandType.valueOf(trojanPackage.request.atyp) == Socks5CommandType.CONNECT) {
Protocol.TCP
} else {
Protocol.UDP
}
)
val odor = Odor(
host = trojanPackage.request.host,
port = trojanPackage.request.port,
originProtocol = Protocol.TROJAN,
desProtocol = if (Socks5CommandType.valueOf(trojanPackage.request.cmd) == Socks5CommandType.CONNECT) {
Protocol.TCP
} else {
Protocol.UDP
}
)
resolveOutbound(inbound = inbound, odor = odor).ifPresent { outbound ->
relayAndOutbound(
RelayAndOutboundOp(
originCTX = originCTX,
Expand Down

0 comments on commit c0349de

Please sign in to comment.