add Prometheus metrics exporter#260
Open
artinsony1982 wants to merge 1 commit into
Open
Conversation
Base configuration (usually leave as is)Do not change port to 80, 443 is required for TelegramListen on all interfaces (0.0.0.0) or specific IPlisten_host = '0.0.0.0' Number of worker threads. Typically equal to number of CPU cores.You can leave it as None to let the script decide based on CPU cores.num_workers = Nonenum_workers = 1 # For a single core CPU, 1 is usually fine. EncryptionSet to True to enable the fake TLS handshake. Recommended for hiding traffic.fake_tls = True The domain to use for the fake TLS handshake.This should be a real domain you own if you want to hide your MTProto traffic.If you don't have one, you can use a placeholder or a common domain.For simplicity and demonstration, we'll use a placeholder here.IMPORTANT: For better stealth, use a domain you own and a valid certificate.For this example, we'll skip the certificate part for simplicity.You can generate a self-signed certificate or use Let's Encrypt later.For now, we'll just use a fake domain without a cert.If fake_tls is True, you MUST provide a domain.Example with a real domain and cert:tls_domain = 'your-domain.com'cert_file = '/etc/letsencrypt/live/your-domain.com/fullchain.pem'key_file = '/etc/letsencrypt/live/your-domain.com/privkey.pem'For this example, we use a placeholder domain and skip certificate files.If fake_tls is True, this is REQUIRED.This domain will appear in your network traffic.tls_domain = 'google.com' # Use a common domain to blend in, or your own domain for better privacy. List of secrets. Each secret can be a string or a tuple.If a secret is a string, it's the secret itself.If a secret is a tuple, it's (secret, tag), where tag is a string displayed in Telegram's connection list.Example:secrets = {"user1": "dd00000000000000000000000000000000","user2": ("dd11111111111111111111111111111111", "My Special Proxy"),}Using the generated secret and a custom tag for clarity.secrets = { Optional: Enable AD Tagging (Recommended)This helps Telegram identify your proxy type.Values: 'telegram', 'telegram-proxy', 'private', 'personal', 'test'Using 'private' and your custom tag.ad_tag = "private" Optional: Enable loggingSet to True to enable logging to a file.logging_enabled = True Path to the log file. Ensure the directory exists and has write permissions.log_file = '/var/log/mtprotoproxy.log' Optional: GeoIP database path (for advanced features, not strictly needed for basic use)geoip_database = '/path/to/GeoIP.dat'Optional: Allowed IPs (if you want to restrict access to specific IPs)allowed_ips = ['1.2.3.4', '5.6.7.8']Optional: Ban old clientsban_old_clients = TrueOptional: Connection concurrency limitsmax_connections = 1000bytes_per_second = 50 * 1024 * 1024 # 50 MB/sbytes_per_second_multiply = 2 |
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.
7fcc854