4net · Documentation
One link. Android and iOS.
Send a subscription from your Telegram bot or website through the 4net HTTPS page. On iOS, a valid subscription is added automatically after the app opens.
The shared HTTPS link
https://vps-tech.ru/open#url=<percent-encoded HTTPS subscription URL>Use this same link for Android, iPhone and iPad. The page selects the platform in the browser, including iPad desktop browsing mode. If the device cannot be identified, the user chooses iOS or Android. The app opens only after tapping Open in 4net; the page does not launch it automatically.
const subscriptionUrl = "https://provider.example/sub/DEMO_ONLY?plan=demo&device=any";
const openIn4net = "https://vps-tech.ru/open#url=" + encodeURIComponent(subscriptionUrl);https://vps-tech.ru/open#url=https%3A%2F%2Fprovider.example%2Fsub%2FDEMO_ONLY%3Fplan%3Ddemo%26device%3DanyEncode the complete original HTTPS subscription URL exactly once, including its path, query parameters and plus signs. Do not add /sub/ or change the provider's token. #url= is a URL fragment, not a query parameter: keep the # separator.
provider.example and DEMO_ONLY are placeholders, not working access. The vps-tech.ru/open page is the actual 4net bridge. A real subscription link is a credential: send it privately to its intended user, not in a public channel, logs or a repository.
A Telegram bot button
Put the openIn4net value from the example above in the bot's URL button. Telegram Bot API accepts HTTP(S) and tg:// button URLs, so use this HTTPS link instead of fournet:// in an inline keyboard.
const reply_markup = {
inline_keyboard: [[{
text: "Open in 4net",
url: openIn4net
}]]
};- The user taps the bot button and opens the 4net page.
- They tap Open in 4net. The page uses the import format for their platform.
- On iOS, the subscription downloads and is added automatically; supported servers are kept if some entries are skipped. An import error is shown without saving an invalid subscription. On Android, complete the import steps shown by the client. Import does not start VPN automatically.
If Telegram's built-in browser blocks the app handoff, open the same HTTPS link in Safari on iPhone/iPad or Chrome on Android, then tap Open in 4net again. Install 4net first if it is not installed. A browser confirmation may appear.
What the bridge does with the link
The subscription is carried in the fragment after #, which is not sent to the web server in the page request. The page processes it only in your browser: it does not fetch, log or send the subscription to another service. After you continue the import in 4net, the client requests the subscription from its provider as usual.
The bridge does not replace the subscription URL or add routing, credentials or connection settings. It chooses the existing platform-specific deep link. Custom-scheme handoff still requires a compatible installed app and the user's tap.
Direct deep link · Android
fournet://import?url=<percent-encoded HTTPS subscription URL>fournet://import?url=https%3A%2F%2Fprovider.example%2Fsub%2FDEMO_ONLY%3Fplan%3Ddemo%26device%3Dandroidconst subscriptionUrl = "https://provider.example/sub/DEMO_ONLY?plan=demo&device=android";
const importUrl = "fournet://import?url=" + encodeURIComponent(subscriptionUrl);For a direct Android integration, encode the complete subscription URL once. The activity handles the link when the app is closed or already open. The supported scheme is fournet://, not 4net://. If VPN is active, disconnect before confirming import.
Direct deep link · iPhone and iPad
fournet://add-proxy?link=<percent-encoded HTTPS subscription URL>The iOS format differs from Android. Do not replace link= with url= or use the Android import host on iOS. The shared HTTPS page above chooses the correct format for the device. iOS import details →