Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/readme/protocol_nethernet_dark.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
config:
layout: elk
theme: redux-dark
look: neo
---
flowchart RL
subgraph subGraph1["Dynamically Added Handlers"]
CompDecoder["<b>NetherNetCompressionDecoder</b><br><i>Decompresses incoming payload</i>"]
CompEncoder["<b>NetherNetCompressionEncoder</b><br><i>Compresses outgoing payload</i>"]
end
subgraph subGraph2["Bedrock Protocol ChannelPipeline (NetherNet)"]
direction TB
Network(("Network Socket"))
subGraph1
PackDec["<b>NetherNetPacketDecoder</b><br><i>Encodes NetherNet Packets</i>"]
PackEnc["<b>NetherNetPacketEncoder</b><br><i>Decodes NetherNet Packets</i>"]
PacketCodec["<b>BedrockPacketCodec</b><br><i>Encodes/Decodes<br>Protocol Packets</i>"]
Peer["<b>BedrockPeer</b><br><i>Session Management</i>"]
Session["<b>BedrockSession</b><br><i>Application Logic</i>"]
end
Network == Compressed <i>ByteBuf</i> ==> CompDecoder
CompDecoder == Decompressed <i>ByteBuf</i> ==> PackDec
PackDec == Packet <i>ByteBuf</i> ==> PacketCodec
PacketCodec == <i>BedrockPacketWrapper</i> ==> Peer & PackEnc
Peer -. <i>BedrockPacket</i> .-> Session
Session -. <i>BedrockPacket</i> .-> Peer
Peer == <i>BedrockPacketWrapper</i> ==> PacketCodec
PackEnc == Packet <i>ByteBuf</i> ==> CompEncoder
CompEncoder == Compressed <i>ByteBuf</i> ==> Network

CompDecoder:::incoming
CompEncoder:::outgoing
PackDec:::incoming
PackEnc:::outgoing
classDef incoming fill:#2ecc71,stroke:#333,stroke-width:2px
classDef outgoing fill:#3498db,stroke:#333,stroke-width:2px
linkStyle 0 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 1 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 2 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 3 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 4 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 5 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 6 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 7 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 8 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 9 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
102 changes: 102 additions & 0 deletions .github/readme/protocol_nethernet_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions .github/readme/protocol_nethernet_light.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
config:
layout: elk
theme: redux
look: neo
---
flowchart RL
subgraph subGraph1["Dynamically Added Handlers"]
CompDecoder["<b>NetherNetCompressionDecoder</b><br><i>Decompresses incoming payload</i>"]
CompEncoder["<b>NetherNetCompressionEncoder</b><br><i>Compresses outgoing payload</i>"]
end
subgraph subGraph2["Bedrock Protocol ChannelPipeline (NetherNet)"]
direction TB
Network(("Network Socket"))
subGraph1
PackDec["<b>NetherNetPacketDecoder</b><br><i>Encodes NetherNet Packets</i>"]
PackEnc["<b>NetherNetPacketEncoder</b><br><i>Decodes NetherNet Packets</i>"]
PacketCodec["<b>BedrockPacketCodec</b><br><i>Encodes/Decodes<br>Protocol Packets</i>"]
Peer["<b>BedrockPeer</b><br><i>Session Management</i>"]
Session["<b>BedrockSession</b><br><i>Application Logic</i>"]
end
Network == Compressed <i>ByteBuf</i> ==> CompDecoder
CompDecoder == Decompressed <i>ByteBuf</i> ==> PackDec
PackDec == Packet <i>ByteBuf</i> ==> PacketCodec
PacketCodec == <i>BedrockPacketWrapper</i> ==> Peer & PackEnc
Peer -. <i>BedrockPacket</i> .-> Session
Session -. <i>BedrockPacket</i> .-> Peer
Peer == <i>BedrockPacketWrapper</i> ==> PacketCodec
PackEnc == Packet <i>ByteBuf</i> ==> CompEncoder
CompEncoder == Compressed <i>ByteBuf</i> ==> Network

CompDecoder:::incoming
CompEncoder:::outgoing
PackDec:::incoming
PackEnc:::outgoing
classDef incoming fill:#2ecc71,stroke:#333,stroke-width:2px
classDef outgoing fill:#3498db,stroke:#333,stroke-width:2px
linkStyle 0 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 1 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 2 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 3 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 4 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 5 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 6 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 7 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 8 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 9 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
102 changes: 102 additions & 0 deletions .github/readme/protocol_nethernet_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions .github/readme/protocol_raknet_dark.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
config:
layout: elk
theme: redux-dark
look: neo
---
flowchart LR
subgraph subGraph1["Dynamically Added Handlers"]
EncDecoder["<b>BedrockEncryptionDecoder</b><br><i>Decrypts incoming payload</i>"]
EncEncoder["<b>BedrockEncryptionEncoder</b><br><i>Encrypts outgoing payload</i>"]
end
subgraph subGraph2["Bedrock Protocol ChannelPipeline"]
direction TB
Network(("Network Socket"))
FrameCodec["<b>FrameIdCodec</b><br><i>Encodes/Decodes<br>RakNet ID (0xFE)</i>"]
subGraph1
CompCodec["<b>CompressionCodec</b><br><i>Compresses/Decompresses<br>Zlib, Snappy, or None</i>"]
BatchDec["<b>BedrockBatchDecoder</b><br><i>Decodes Batched Packets</i>"]
BatchEnc["<b>BedrockBatchEncoder</b><br><i>Encodes Batched Packets</i>"]
PacketCodec["<b>BedrockPacketCodec</b><br><i>Encodes/Decodes<br>Protocol Packets</i>"]
Peer["<b>BedrockPeer</b><br><i>Session Management</i>"]
Session["<b>BedrockSession</b><br><i>Application Logic</i>"]
end
Network == Inbound <i>RakMessage</i> ==> FrameCodec
FrameCodec == Encrypted <i>BedrockBatchWrapper</i> ==> EncDecoder
EncDecoder == Decrypted <i>BedrockBatchWrapper</i> ==> CompCodec
CompCodec == Decompressed <i>BedrockBatchWrapper</i> ==> BatchDec
BatchDec == Packet <i>ByteBuf</i> ==> PacketCodec
PacketCodec == <i>BedrockPacketWrapper</i> ==> Peer
Peer -. <i>BedrockPacket</i> .-> Session
Session -. <i>BedrockPacket</i> .-> Peer
Peer == <i>BedrockPacketWrapper</i> ==> PacketCodec
PacketCodec == <i>BedrockPacketWrapper</i> ==> BatchEnc
BatchEnc == Uncompressed <i>BedrockBatchWrapper</i> ==> CompCodec
CompCodec == Compressed <i>BedrockBatchWrapper</i> ==> EncEncoder
EncEncoder == Encrypted <i>BedrockBatchWrapper</i> ==> FrameCodec
FrameCodec == Outbound <i>CompositeByteBuf</i> ==> Network

EncDecoder:::incoming
EncEncoder:::outgoing
BatchEnc:::outgoing
BatchDec:::incoming
classDef incoming fill:#2ecc71,stroke:#333,stroke-width:2px
classDef outgoing fill:#3498db,stroke:#333,stroke-width:2px
linkStyle 0 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 1 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 2 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 3 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 4 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 5 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 6 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 7 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 8 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 9 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 10 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 11 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 12 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 13 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
102 changes: 102 additions & 0 deletions .github/readme/protocol_raknet_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions .github/readme/protocol_raknet_light.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
config:
layout: elk
theme: redux
look: neo
---
flowchart LR
subgraph subGraph1["Dynamically Added Handlers"]
EncDecoder["<b>BedrockEncryptionDecoder</b><br><i>Decrypts incoming payload</i>"]
EncEncoder["<b>BedrockEncryptionEncoder</b><br><i>Encrypts outgoing payload</i>"]
end
subgraph subGraph2["Bedrock Protocol ChannelPipeline"]
direction TB
Network(("Network Socket"))
FrameCodec["<b>FrameIdCodec</b><br><i>Encodes/Decodes<br>RakNet ID (0xFE)</i>"]
subGraph1
CompCodec["<b>CompressionCodec</b><br><i>Compresses/Decompresses<br>Zlib, Snappy, or None</i>"]
BatchDec["<b>BedrockBatchDecoder</b><br><i>Decodes Batched Packets</i>"]
BatchEnc["<b>BedrockBatchEncoder</b><br><i>Encodes Batched Packets</i>"]
PacketCodec["<b>BedrockPacketCodec</b><br><i>Encodes/Decodes<br>Protocol Packets</i>"]
Peer["<b>BedrockPeer</b><br><i>Session Management</i>"]
Session["<b>BedrockSession</b><br><i>Application Logic</i>"]
end
Network == Inbound <i>RakMessage</i> ==> FrameCodec
FrameCodec == Encrypted <i>BedrockBatchWrapper</i> ==> EncDecoder
EncDecoder == Decrypted <i>BedrockBatchWrapper</i> ==> CompCodec
CompCodec == Decompressed <i>BedrockBatchWrapper</i> ==> BatchDec
BatchDec == Packet <i>ByteBuf</i> ==> PacketCodec
PacketCodec == <i>BedrockPacketWrapper</i> ==> Peer
Peer -. <i>BedrockPacket</i> .-> Session
Session -. <i>BedrockPacket</i> .-> Peer
Peer == <i>BedrockPacketWrapper</i> ==> PacketCodec
PacketCodec == <i>BedrockPacketWrapper</i> ==> BatchEnc
BatchEnc == Uncompressed <i>BedrockBatchWrapper</i> ==> CompCodec
CompCodec == Compressed <i>BedrockBatchWrapper</i> ==> EncEncoder
EncEncoder == Encrypted <i>BedrockBatchWrapper</i> ==> FrameCodec
FrameCodec == Outbound <i>CompositeByteBuf</i> ==> Network

EncDecoder:::incoming
EncEncoder:::outgoing
BatchEnc:::outgoing
BatchDec:::incoming
classDef incoming fill:#2ecc71,stroke:#333,stroke-width:2px
classDef outgoing fill:#3498db,stroke:#333,stroke-width:2px
linkStyle 0 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 1 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 2 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 3 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 4 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 5 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 6 stroke:#2ecc71,stroke-width:4px,color:#2ecc71,_,fill:none
linkStyle 7 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 8 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 9 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 10 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 11 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 12 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
linkStyle 13 stroke:#3498db,stroke-width:4px,color:#3498db,_,fill:none
102 changes: 102 additions & 0 deletions .github/readme/protocol_raknet_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 85 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ proxy:
destination:
host: 127.0.0.1
port: 19132
# Joins a featured server based on its title, looking up the experience ID if needed
# featured-server-title: "SoulSteel"
# Joins a featured server based on its experience ID
# experience-id: "e3da296b-8be0-4d79-8608-e53d60531b7b"
## Run the proxy in online mode. This will require login with a Microsoft account on start.
online-mode: true
## Save credentials when in online mode for future logins.
Expand Down Expand Up @@ -64,6 +60,71 @@ ignored-packets:
- "ClientCacheMissResponsePacket"
```

The destination field also supports special joining types for featured servers by experience ID, realms, and LAN games:

<details>

<summary>Featured Servers by Title</summary>

```yaml
destination:
# Joins a featured server based on its title, looking up the experience ID if needed
featured-server-title: "SoulSteel"
```

</details>

<details>

<summary>Featured Servers by Experience ID</summary>

```yaml
destination:
# Joins a featured server based on its experience ID
experience-id: "e3da296b-8be0-4d79-8608-e53d60531b7b"
```

</details>

<details>

<summary>LAN Games</summary>

```yaml
destination:
host: 192.168.0.2 # LAN server IP
port: 7551 # Nethetnet discovery occurs on port 7551 by default
transport: nethernet # LAN now uses Nethernet transport
```

</details>

<details>

<summary>Realms</summary>

```yaml
destination:
# Join a realm by specifying its name
realm-name: MyRealm
transport: nethernet # Realms now uses Nethernet transport
```

</details>

<details>

<summary>Nethernet ID</summary>

```yaml
destination:
# Join a server by its Nethernet ID
nethernet-id: 18eaa765-c0b4-44ac-9bba-7dca64ebf990
transport: nethernet
```

</details>

On attempting to connect in online mode, your default web browser will direct you to a Microsoft login page requesting a token. This token has been copied to your clipboard, which you can paste into the prompt to continue. You will then be prompted to login with your Microsoft account, which of course must be associated with a valid Xbox Live account with a Minecraft character. Note that some servers may disconnect you if this process takes to long. If this is the case, simply leave ProxyPass running and login again after completing this initial login process. You will not be prompted to login again as long as ProxyPass is still running. By default, your credentials for future logins are saved. This can be disabled by setting `save-auth-details` to `false` in the `config.yml` file.

### Building & Running
Expand All @@ -90,6 +151,26 @@ This project utilizes git submodules and [Gradle Composite Builds](https://docs.

ProxyPass directly depends on the protocol submodule via the root [settings.gradle.kts](./settings.gradle.kts). Protocol then depends on the network submodule via its own [settings.gradle.kts](https://github.com/Kas-tle/Protocol/blob/50836b73f09103de9e5539c14da3fe05deec6c54/settings.gradle.kts). We can observe in a [gradle build scan](https://scans.gradle.com/s/gu5fploqzyafs) that dependency resolution for both [Protocol](https://scans.gradle.com/s/gu5fploqzyafs/dependencies?focusedDependency=WzAsMSwxMDAsWzAsMSxbMTAwXV1d&focusedDependencyView=details&toggled=W1swXSxbMCwxXV0) and [Network](https://scans.gradle.com/s/gu5fploqzyafs/dependencies?focusedDependency=WzMsMSwyMzIsWzMsMSxbMjMyXV1d&focusedDependencyView=details&toggled=W1szXSxbMywxXV0) were selected by composite build substitution rather than from a Maven repository.

### Packet Flows

#### Raknet

---

<picture>
<source media="(prefers-color-scheme: dark)" srcset=".github/readme/protocol_raknet_dark.svg">
<img src=".github/readme/protocol_raknet_light.svg">
</picture>

#### Nethernet

---

<picture>
<source media="(prefers-color-scheme: dark)" srcset=".github/readme/protocol_nethernet_dark.svg">
<img src=".github/readme/protocol_nethernet_light.svg">
</picture>

### Links
- [Releases](https://github.com/Kas-tle/ProxyPass/releases)
- [Auth Library](https://github.com/RaphiMC/MinecraftAuth) used in this project by [RaphiMC](https://github.com/RaphiMC)
Expand Down
24 changes: 24 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,23 @@ repositories {
mavenCentral()
maven("https://repo.opencollab.dev/maven-snapshots")
maven("https://repo.opencollab.dev/maven-releases")
maven("https://jitpack.io")
}

val nativePlatforms = listOf(
"windows-x86_64",
"windows-aarch64",
"linux-x86_64",
"linux-aarch64",
"macos-x86_64",
"macos-aarch64"
)

dependencies {
compileOnly(libs.lombok)

annotationProcessor(libs.lombok)

implementation(libs.bedrock.codec)
implementation(libs.bedrock.common)
implementation(libs.bedrock.connection)
Expand All @@ -42,6 +54,15 @@ dependencies {
implementation(libs.richtextfx)
implementation(libs.atlantafx)
implementation(libs.checker.qual)
implementation(libs.netty.transport.nethernet)

nativePlatforms.forEach { platform ->
runtimeOnly(libs.webrtc.java) {
artifact {
classifier = platform
}
}
}
}

application {
Expand All @@ -51,6 +72,9 @@ application {
tasks.shadowJar {
archiveClassifier.set("")
archiveVersion.set("")
manifest {
attributes["Enable-Native-Access"] = "ALL-UNNAMED"
}
transform(Log4j2PluginsCacheFileTransformer())
filesMatching("META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
Expand Down
5 changes: 4 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ bedrock-common = { group = "org.cloudburstmc.protocol", name = "common" }
bedrock-connection = { group = "org.cloudburstmc.protocol", name = "bedrock-connection" }
checker-qual = { group = "org.checkerframework", name = "checker-qual", version = "3.37.0" }
jackson-dataformat-yaml = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-yaml", version = "2.17.2" }
minecraftauth = { group = "net.raphimc", name = "MinecraftAuth", version = "5.0.0" }
# minecraftauth = { group = "net.raphimc", name = "MinecraftAuth", version = "5.0.0" }
minecraftauth = { group = "dev.kastle", name = "MinecraftAuth", version = "f3d6e3fbc8" }
log4j = { group = "org.apache.logging.log4j", name = "log4j-core", version = "2.12.2" }
lombok = { group = "org.projectlombok", name = "lombok", version = "1.18.42" }
richtextfx = { group = "org.fxmisc.richtext", name = "richtextfx", version = "0.11.6" }
atlantafx = { group = "io.github.mkpaz", name = "atlantafx-base", version = "2.1.0" }
webrtc-java = { group = "dev.kastle.webrtc", name = "webrtc-java", version = "1.0.3" }
netty-transport-nethernet = { group = "dev.kastle.netty", name = "transport-nethernet" }

[plugins]
shadow = { id = "com.gradleup.shadow", version = "9.2.2" }
Expand Down
Loading