Adding servers
Web proxy: Cloudflare and ArvanCloud
Buy a dedicated web proxy server or upgrade a running cloud server, connect your Cloudflare or ArvanCloud account in Domains, and the proxy is set up on your domain automatically.
Updated
What a web proxy is
A web proxy is a Telegram proxy that runs on your own domain. Users connect to it over WebSocket or HTTPS. The domain is set up in your own Cloudflare or ArvanCloud account.
There are two ways to get one. You can buy a dedicated server only for the web proxy. Or you can add a web proxy to a cloud server that is already running, with "Upgrade to web proxy".
On a dedicated server you choose how it works: in our pool, with your own ad tag, or without a tag. The proxy is installed automatically, and its link appears on the server page.
What a web proxy needs
- A Cloudflare or ArvanCloud account. You connect it once in the Domains app, under "CDN & DNS".
- A web proxy domain. You buy it in the Domains app; its price is shown before you buy.
- A shop. Domains are bought for your shop; if you have none, the page asks you to create it first.
- For a dedicated server: enough wallet balance for the first month and the one-time setup fee. Both amounts are shown before you pay.
Buying a dedicated web proxy server
- In the Servers app, press "Buy server". Under "Dedicated server · to earn", press "Buy a dedicated server".
- "Which server?": choose a server. Each one shows its monthly price and, if it has one, its one-time setup fee.
- Under "Datacenter", choose where the server runs; each one shows its own price. Your web proxy later runs in this same datacenter.
- "Confirm the order": check "Monthly", "One-time setup", "Charged now" and your wallet balance, then press "Pay & order".
- On "Dedicated server bought", press "Open the server", or "Later".
- If your balance is not enough, the order screen says so and nothing is charged. Press "Top up", add funds and place the order again.
Connecting Cloudflare
Cloudflare is connected with an API token you create in your own account. You do it once, in the Domains app under "CDN & DNS".
- If you have no Cloudflare account, create a free one at dash.cloudflare.com/sign-up.
- Open the Domains app, go to "CDN & DNS" and press "Manage Cloudflare". The "Connect Cloudflare" button in the switch-on steps brings you here too.
- Press "Create token on Cloudflare". Cloudflare opens with every permission already filled in for all your zones and accounts. Check the list, press "Continue to summary", then "Create Token", and copy the token; Cloudflare shows it only once.
- Paste the token into "API Token" and press "Connect". The token is checked with Cloudflare first; a token that fails the checks is not saved, and the reason is shown under the field.
- If the pre-filled page does not open, create the token by hand: My Profile → API Tokens → Create Token → Create Custom Token, with the permissions under "Required permissions", for "All zones" and "All accounts".
- "Connected" means the token passed the checks: it is active, reads your account, lists your domains and, once the account has a domain, reads its DNS records. The page shows the account name, the number of domains (zones), the token type and the last check. Write permissions cannot be tested without changing your account, so create the token with the list shown.
- "Check again" runs the checks again. "Not working" means the saved token no longer passes them: create a new token and connect it with "Replace token".
- "Disconnect" deletes the saved token. Nothing changes in your Cloudflare account, and you can connect again any time.
Connecting ArvanCloud
ArvanCloud is an Iranian CDN and DNS service. You connect it with an API key from your own ArvanCloud account.
- If you have no ArvanCloud account, create one at accounts.arvancloud.ir.
- Open the Domains app, go to "CDN & DNS" and press "Manage ArvanCloud".
- Press "Open machine users on ArvanCloud" and create a machine user there. Copy its key right away; ArvanCloud shows it only once. Then, under "Resources and access", create an access policy with five roles (DNS, domain, CDN, domain security and Purge) and add the machine user to it.
- Paste only the key into "API key", without the word "apikey", and press "Connect".
- "Connected" means the key passed the checks. "Connected · insufficient access" means the key lacks some access the web proxy needs; the page lists which. Add the missing roles to the machine user's access policy, or create a new machine user and connect its key with "Replace key".
- "Check again", "Not working" and "Disconnect" work as for Cloudflare. Disconnecting changes nothing in your ArvanCloud account.
Switching the dedicated server on
Open the server in the Servers app and press "Turn on". A four-step wizard opens: "Prerequisites", "Mode", "Config type" and "Confirm". "Continue" is enabled once the step is complete.
You do not choose a region: the proxy runs in the datacenter the server was bought for.
- "DNS provider" is the account your domain is set up in. Choose "Cloudflare" or "ArvanCloud". A connected one shows "Cloudflare account connected" or "ArvanCloud account connected"; otherwise press "Connect Cloudflare" or "Connect ArvanCloud".
- "Domain": choose one of your web proxy domains, then press "Continue". If you have none yet, press "Buy a domain", pick an available name and pay for it from your wallet. A domain that is still "registering" or serves another server cannot be chosen.
- "What should it run?": "Pool (earn)" joins our pool and earns hourly; "MTProto · my ad tag" promotes your channel with the 32-character tag from @MTProxybot, which you enter right there; "MTProto · no tag" has no sponsored channel.
- "How do clients connect?": choose "WebSocket · lanes", "WebSocket", "HTTPS" or "HTTPS · lanes". "Lanes" spreads the connections over several paths. For a domain in ArvanCloud, choose "HTTPS"; the page marks it "Recommended behind ArvanCloud".
- "Confirm and switch on": check the summary. If you like, write something in "Note for our team (optional)", then press "Turn on and install".
- A domain keeps the DNS provider of its first proxy. For such a domain the page says "This domain is set up in …", and the other option cannot be chosen. To change it, move the domain in the Domains app.
- On ArvanCloud, WebSocket connections keep dropping, so the page marks them as unstable there.
After switching the server on
- The rest is automatic: the DNS record in your account, the proxy and its certificate, and the CDN protection. You get a notification when it is ready.
- The server page has a "Web proxy" box with the protocol and the domain. Under "Automatic setup" it shows the current step, for example "Waiting for … to activate your domain" or "Installing the proxy and its certificate…". "Refresh" shows the latest step.
- When it says "Running", the box also shows "Behind Cloudflare" or "Behind ArvanCloud". The link is then ready in "Connection link", with "Copy", "Open in Telegram" and "Share link".
- The link starts with tg://webproxy and carries your domain. "Share link" copies this same link.
- If it says "Setup failed", you do not need to do anything: our team has been notified and finishes it.
- In the "Pool (earn)" mode the server earns hourly like the other pool servers.
Upgrading a cloud server to a web proxy
A cloud server that is on, in the pool or as an MTProto proxy, can get a web proxy beside it. It gets a second link: a Telegram web proxy on your own domain.
Nothing changes on the server. It does not restart, keeps running, and its old link keeps working.
- Open the server in the Servers app and press "Upgrade to web proxy". A three-step wizard opens.
- "Your CDN account and your domain": under "DNS provider", choose "Cloudflare" or "ArvanCloud". If it is not connected, paste the token or key right there and press "Connect".
- Choose a domain. If you have none, search a name under "Buy a new domain" and pay from your wallet. A new domain shows "registering" for a short while. Then press "Continue".
- "How should clients connect?": choose the protocol ("HTTPS" for a domain in ArvanCloud) and press "Continue".
- "Confirm and add the web proxy": check "Current link (stays)" and the new domain, then press "Request the web proxy".
- Meanwhile the server page shows "Installing the web proxy on …" with the setup step. The server stays on.
- When it is ready, a second box, "Web proxy link (your domain)", appears under the first link. Both links work, and you get a notification.
- "Upgrade to web proxy" is not shown when the server is off, already has a web proxy, or has a request open.
- Switching the server off removes its web proxy and that link too.
Moving a domain between Cloudflare and ArvanCloud
A web proxy domain bought from us can move to your other account, for example from Cloudflare to ArvanCloud. The domain and its link stay the same.
- Connect the other account first, in "CDN & DNS".
- In the Domains app, under "Web proxy domains", press the domain to open its settings.
- Press "Move to ArvanCloud" (or "Move to Cloudflare"), read the message and press "Move the domain".
- A running proxy keeps working, but it may be unreachable for a few minutes while the nameservers change.
- Only our proxy record is moved. Other DNS records you made yourself in the old account are not.
- While a proxy on the domain is still being set up, the move is refused; wait until it is running.
Changing the web proxy domain
A dedicated web proxy server that is on can move to another of your web proxy domains without being switched off.
- On the server page, press "Change domain" in the "Web proxy" box.
- Choose another domain. If you have none, press "Buy another domain". For a domain without a proxy, also choose its "DNS provider".
- Press "Request the change". A message warns that the old link stops working; press "Change domain" to confirm.
- The server stays on. The page shows "Moving to …" while the proxy is set up on the new domain, and the link switches once it is live. After that the old link stops working, so give your users the new one.
- "Change domain" is shown only while the server is on and has no other request open. A Cloudflare or ArvanCloud account must be connected.
What you do not need to do for the web proxy
- You do not add DNS records or change Cloudflare or ArvanCloud settings yourself; the automatic setup does it in your account.
- For a domain bought from us, you do not change its nameservers; that is done for you.
- You do not install anything or log in to any server.
- If something does not work, do not switch the server off and on: switching off removes the proxy and its link. Open a ticket in the Support app and our team fixes it.
Frequently asked questions
- Why can I not go past the first step? It says "Connect your Cloudflare account".
- The domain is set up in your own Cloudflare or ArvanCloud account, so "Continue" stays disabled until the account chosen under "DNS provider" is connected. The English messages "Connect a Cloudflare or ArvanCloud account first", "Your Cloudflare token no longer works" and "Your ArvanCloud API key no longer works" mean the same. Press "Connect Cloudflare" or "Connect ArvanCloud" on that step and connect the account. If the status is "Not working", create a new token or key and connect it with "Replace token" or "Replace key".
- Cloudflare or ArvanCloud: which one should I choose?
- Both work the same way; choose the one you have an account with or prefer. Cloudflare is a global CDN with a free account, and ArvanCloud is an Iranian one. Behind ArvanCloud, choose the "HTTPS" protocol, because WebSocket keeps dropping there. A domain keeps its provider after its first proxy; you can move it later in the Domains app.
- My new dedicated server says "Awaiting setup". When can I switch it on?
- After the purchase, our team prepares the server first, and until then it cannot be switched on. You get a notification when it is ready; then press "Turn on" on the server page. Meanwhile, connect your Cloudflare or ArvanCloud account and buy a web proxy domain.
- Does "Upgrade to web proxy" change my cloud server or its link?
- No. The server does not restart, keeps running, and its old link keeps working. It only gets a second link, a web proxy on your own domain, shown in "Web proxy link (your domain)". If you switch the server off, that second link is removed too.
- Can I use my own domain for the web proxy?
- Yes, for the web proxy only, and only with Cloudflare: our team can register a domain you bought elsewhere as one of your web proxy domains. First add the domain to your own Cloudflare account and, at your registrar, set its nameservers to the ones Cloudflare gives you. Then open a ticket in the Support app with the "Server" category and the domain name. Once it is registered, you choose it under "Domain"; you renew it yourself at your registrar. A domain bought elsewhere cannot be connected to the shop or to the proxy domains.
- Where is the link of the web proxy?
- When the automatic setup finishes and the server page says "Running", the link appears in "Connection link", with "Copy", "Open in Telegram" and "Share link". For an upgraded cloud server it is in "Web proxy link (your domain)". It starts with tg://webproxy and carries your domain, and you also get a notification. Until then, "Automatic setup" shows the current step. "Waiting for … to activate your domain" means Cloudflare or ArvanCloud has not activated the domain yet; the setup moves on by itself.
- Is my Cloudflare token or ArvanCloud key safe? What access does it have?
- It is checked before it is saved, kept encrypted, and never shown again in the panel. A Cloudflare token has the permissions under "Required permissions": edit Zone, DNS, Zone Settings, SSL and Certificates, Page Rules and Firewall Services, purge the cache, and read Account Settings. An ArvanCloud key carries your user's access to the CDN service. With it, your domain, its DNS record and its protection are set up in your own account. You can delete it any time with "Disconnect".
- What happens if I disconnect Cloudflare or ArvanCloud?
- The saved token or key is deleted, and nothing changes in your account there. A web proxy that is already running keeps running. Until you connect again, you cannot set up a new proxy on that account's domains or change a domain. Do not disconnect while an automatic setup is still in progress, because it needs that access. You can connect again any time from Domains → "CDN & DNS".
- The automatic setup of the web proxy failed. What do I do?
- You do not need to do anything: when it says "Setup failed", our team has already been notified and finishes it. Do not switch the server off and on, because switching off removes the proxy and its link. If an error said there is no room right now, try again a little later. If you have a question, open a ticket in the Support app with the "Server" category and the server's serial.