Announce the NAT-ed public address to the Telegram middle-ends. - #4
Open
tral wants to merge 1 commit into
Open
Conversation
Official MTProxy puts the address of its own interface in the RPC handshake it sends to each middle-end. On a cloud instance whose public address is NAT-ed onto a private interface address, that announcement does not match the source address Telegram observes, and every middle-end closes the connection immediately after the handshake completes. MTProxy reconnects with no backoff. On an Oracle Cloud instance with a 10.0.0.0/24 interface address this produced 3565 outbound connections in 15 seconds, which exhausted the host conntrack table within a minute; the kernel then dropped packets for every service on the host, so the relay could not reach its own backend either. The visible symptom is a client that reports the proxy as online and never finishes connecting. Derive --nat-info from the interface address that routes to a real proxy_for target and from the hostname's A record, which is by definition this server's public address because Caddy could not otherwise obtain a certificate for it. --public-ip overrides the resolved value. With the mapping in place the same 15 seconds opened 76 connections and closed none. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Official MTProxy puts the address of its own interface in the RPC handshake it sends to each middle-end. On a cloud instance whose public address is NAT-ed onto a private interface address, that announcement does not match the source address Telegram observes, and every middle-end closes the connection immediately after the handshake completes.
MTProxy reconnects with no backoff. On an Oracle Cloud instance with a 10.0.0.0/24 interface address this produced 3565 outbound connections in 15 seconds, which exhausted the host conntrack table within a minute; the kernel then dropped packets for every service on the host, so the relay could not reach its own backend either. The visible symptom is a client that reports the proxy as online and never finishes connecting.
Derive --nat-info from the interface address that routes to a real proxy_for target and from the hostname's A record, which is by definition this server's public address because Caddy could not otherwise obtain a certificate for it. --public-ip overrides the resolved value. With the mapping in place the same 15 seconds opened 76 connections and closed none.