Skip to content

Commit 09efce9

Browse files
authored
add pomme-relay (#991)
* add pomme-relay, the browser build's server * stop the relay following redirects, limit ipv6 clients by their /64, relay the path as written, close silent connections * bridge a connection only once it opens with a handshake, limit downloads by bytes, bound the limiter table, read the proxy's own forwarded entry * cut a download off at its byte limit, keep limiter buckets still in debt, time out dns and the first write, refuse more reserved ipv6 ranges * resolve server names with the async resolver, pass content-length through, don't cut downloads the limiter can't track, accept only global unicast ipv6 * count game connection bytes against the client's allowance, read request bodies only after the checks and cap them, refuse the relay machine's own addresses, dial a name's addresses together, log refusals at debug * refuse a dial when the own-address check can't tell, take networks as --block-address, count the opening and non-binary messages, answer unresolvable names like unreachable ones, time out request bodies * reject a blocked network written as ipv4 inside ipv6, charge every websocket message its bytes and a fixed cost from the first, log an unresolvable name once * match blocked networks and the machine's own addresses against an address as resolved and as the ipv4 it carries, dial two addresses of each family, charge an opening that isn't binary * stop checking a family's addresses once it has enough to dial, give a relayed response ten minutes in all * resolve names with an underscore as the desktop client does, skip dns for an address * ask dns for a non-ascii name in its ascii form
1 parent 68392f6 commit 09efce9

10 files changed

Lines changed: 2257 additions & 14 deletions

File tree

‎Cargo.lock‎

Lines changed: 190 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
resolver = "3"
33
members = [
44
"pomme-android",
5+
"pomme-relay",
56
"pomme-ios",
67
"pomme-auth",
78
"pomme-install",

‎justfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ ci-fmt:
152152
ci-lint:
153153
@cargo clippy -p pomme-client --release --all-targets --no-default-features --features {{ lint_features }} -- -D warnings
154154
@cargo clippy -p pomme-protocol -p pomme-auth --release --all-targets --all-features -- -D warnings
155-
@cargo clippy -p pomme-dirs -p pomme-install -p azalea-block -p pomme-registry -p azalea-registry -p pomme-text -p pomme-item -p azalea-inventory -p ingame-test -p protogen -p blockgen -p typegen --release --all-targets -- -D warnings
155+
@cargo clippy -p pomme-dirs -p pomme-install -p pomme-relay -p azalea-block -p pomme-registry -p azalea-registry -p pomme-text -p pomme-item -p azalea-inventory -p ingame-test -p protogen -p blockgen -p typegen --release --all-targets -- -D warnings
156156

157157
# Tests, in the dev profile (dependencies are optimised there).
158158
ci-test:
159-
@cargo nextest run -p pomme-protocol -p pomme-dirs -p pomme-auth -p pomme-install -p pomme-registry -p pomme-text -p pomme-item -p azalea-inventory -p ingame-test -p typegen -p protogen
159+
@cargo nextest run -p pomme-protocol -p pomme-dirs -p pomme-auth -p pomme-install -p pomme-relay -p pomme-registry -p pomme-text -p pomme-item -p azalea-inventory -p ingame-test -p typegen -p protogen
160160
@cargo nextest run -p pomme-client --no-default-features
161161

162162
# SteelMC's crate, the client with it, and the test that boots a real world.

0 commit comments

Comments
 (0)