Chuyển tới nội dung chính

Outbound requests

The Yêu cầu ra ngoài tab of the Cài đặt Qubix window, in the Bảo vệ group. Here you choose how the server's requests reach the internet: directly from the server's address, through your SOCKS proxy or through Tor. With a proxy or Tor, the services the server contacts see the address of the proxy or of a Tor exit instead of the server's own address. The help note of the row — the question mark in the window — says: Cách máy chủ kết nối ra internet: trực tiếp từ địa chỉ của chính nó, qua proxy SOCKS của bạn hoặc qua Tor. Proxy được kiểm tra trước khi lưu và sẽ không được lưu nếu không phản hồi; “Kiểm tra” hiển thị địa chỉ mà máy chủ được nhìn thấy từ bên ngoài. Một số yêu cầu đi vòng qua tuyến đã chọn — chúng được liệt kê trong phần mô tả phía trên bộ chọn. Nếu tuyến đã chọn không phản hồi, máy chủ sẽ không ra ngoài internet chút nào. Chỉ quản trị viên mới thấy thẻ này.

Who sees the tab

This tab is shown to an administrator only.

Ways out​

The info mark next to the name of the Cách máy chủ kết nối ra internet field says: Mọi yêu cầu mà máy chủ gửi ra thế giới bên ngoài — hình ảnh trong thư, Google, trợ lý, Telegram và các thứ khác — đều đi theo cách được chọn ở đây. Những yêu cầu sau đi vòng qua nó: Facebook, như trước đây, qua proxy riêng của từng hồ sơ hoặc trực tiếp; Cloudflare và Namecheap, trực tiếp, vì khóa của chúng gắn với địa chỉ của máy chủ; máy chủ giấy phép của chúng tôi, bước kiểm tra cổng và các bước kiểm tra DNS của tên miền, trực tiếp; gói đăng ký Claude và các tài khoản của Nhóm AI nội bộ, trực tiếp từ địa chỉ của máy chủ hoặc qua proxy của tài khoản; API AI bên ngoài, không qua proxy, qua một proxy của nhóm hoặc qua Tor, theo lựa chọn của API; các host trong mạng riêng của bạn mà script và kho tệp của trò chuyện được cung cấp bằng địa chỉ IP, trực tiếp — một host trong mạng của bạn được cung cấp bằng tên thì không thể kết nối qua proxy hay Tor của bạn. Khi cách đã chọn không phản hồi, máy chủ hoàn toàn không ra ngoài. It goes on: Qua proxy hoặc Tor của bạn, bất kỳ ai chuyển tiếp kết nối đều có thể đọc và thay đổi nó nếu nó không được mã hóa: địa chỉ http:// trong yêu cầu của script, một postback hay một webhook sẽ đi ở dạng không mã hóa cho đến tận proxy hoặc nút thoát của Tor. Cơ sở dữ liệu của script chỉ được kết nối qua Tor khi kết nối xác minh máy chủ cơ sở dữ liệu: sslmode=verify-full với PostgreSQL, tls=true với MySQL, encrypt=strict với SQL Server, địa chỉ clickhouses:// với ClickHouse, và chế độ “Mã hóa và xác minh chứng chỉ” với một kết nối đã lưu.

The field offers three ways:

  • Trực tiếp, từ địa chỉ của máy chủ — the server goes out from its own address. This is how a server works until an administrator chooses another way.
  • Qua proxy SOCKS của bạn — requests go through a SOCKS5 proxy whose address you enter.
  • Qua Tor — requests go through the Tor network. Tor runs in a container of its own on the server: the server raises it when you choose Tor and removes it when you choose another way.

Not every request takes the chosen way: Facebook, Cloudflare, Namecheap, the license server and a few other kinds of requests go past it — the full list is in What goes past the chosen way.

If the chosen proxy or Tor stops answering, the requests that go this way are refused: the server does not fall back to its own address. As soon as the way answers, requests go out again; a request refused in the meantime is not resent by the way itself. What goes past the way keeps working all along.

How to switch to your proxy​

  1. Open Cài đặt Qubix → Yêu cầu ra ngoài.
  2. In the Cách máy chủ kết nối ra internet field, choose Qua proxy SOCKS của bạn. The Địa chỉ proxy SOCKS field appears; the example in it reads socks5://login:password@host:port
  3. Enter the proxy address: socks5://host:port, or socks5://login:password@host:port if the proxy asks for a login. The description of the field says: socks5://login:password@host:port. Trước khi lưu, máy chủ kiểm tra xem proxy có phản hồi hay không. The socks5h:// scheme is accepted as well, and an address without a scheme is read as socks5://.
  4. Click Lưu. Before saving, the server sends a request through the proxy to find out which address the outside world sees. If the address is not a SOCKS5 one or the proxy does not answer, nothing is saved, and the reason is shown next to the button: a proxy that does not answer would stop every request that goes this way.

Under the field description the saved proxy is shown — Hiện tại: … with its host and port, or Hiện tại: …, kèm thông tin đăng nhập when it has a login; the login and password themselves are not shown. The saved address stays when you switch to another way. To go back to it, choose Qua proxy SOCKS của bạn again and save with the field left empty: the server checks the saved proxy and uses it. Enter an address only to replace the saved one.

In this mode the server looks up the names of its requests itself, through its usual DNS server, makes sure the address is not one of an internal network and hands the proxy the checked address rather than the name — with either of the two schemes. That is why a proxy in your own network cannot be used to reach into that network.

How to switch to Tor​

  1. Open Cài đặt Qubix → Yêu cầu ra ngoài.
  2. In the Cách máy chủ kết nối ra internet field, choose Qua Tor.
  3. Click Lưu. Unlike a proxy, Tor is saved without a check: the way takes effect at once, and the server downloads the Tor image and raises the container in the background.
  4. Click Kiểm tra in the Đường ra group and wait until it shows the address the outside world sees. Until the container is up, the requests that go this way are refused.

The Đường ra group shows the state of the Tor container; it is read when the tab opens and with every check:

  • Container Tor đang chạy.
  • Chưa có container Tor: nó sẽ được khởi tạo khi Tor được chọn.
  • Container Tor đã dừng.
  • Máy chủ không kết nối được tới Docker, nên không thể kiểm tra container Tor.

While Tor is chosen, the server checks the container every five minutes and raises it again if it has disappeared or stopped. Each time the server starts — after a Qubix update, for example — the container is brought to the Tor version that the installed release carries.

Checking the way out​

When a proxy or Tor is saved, the Đường ra group appears under the choice of the way. While the server goes out directly, there is nothing to check, and the group is not shown.

Click Kiểm tra: the server sends a request through the way in force and shows the answer:

  • Thế giới bên ngoài nhìn thấy địa chỉ …. — the way works, and this is the address seen by the services the server contacts. When the address belongs to a Tor exit, the line says so as well — Thế giới bên ngoài nhìn thấy địa chỉ …, một nút thoát của Tor. — the server learns this from the Tor Project's own check. If that check does not answer and another address service does, the line comes without this mark — even in the Tor mode.
  • A line saying that the way out does not answer, with the details below it: Chi tiết: … Only the requests that go this way stop: they are refused until the way answers, and what goes past the way keeps working.

What goes past the chosen way​

These requests do not take the way chosen on the tab, whichever it is:

  • Facebook. Requests to Facebook go, as before, through the browser profile's own proxy, or directly when the profile has none. Conversions sent to Facebook (Conversions API), the pixel check, the check of a profile's proxy and the downloading of ad pictures and videos go directly.
  • Cloudflare and Namecheap — directly: their keys are tied to the server's address. Checking a domain through the Cloudflare network goes directly too, and so does finding out the server's own address: through Tor, the server would learn the address of a Tor exit instead of its own.
  • Our license server — directly: the license check and what the server downloads from it, such as updates of the geo and cloak databases.
  • The port check and the DNS checks of domains — directly, by their very purpose: a port check has to come from the server's own address, and a SOCKS proxy does not carry DNS queries.
  • A request with its own proxy. A fetch call that names its own proxy — the proxy field of ctx.fetch in scripts — goes to that proxy directly from the server; see Writing a script.
  • External AI APIs — directly from the server's own address unless a proxy is chosen for the API. The way is set in the API's window in Cài đặt Qubix → API AI bên ngoài, in the Proxy field: Không dùng proxy, a proxy of Nhóm AI nội bộ → Proxies, or Tor. Through Tor the API's key goes over https:// only, so an API with an http:// address is not saved with Tor.
  • Hosts of your internal network:
    • a fetch request of a script, a Britva rule or a site page handler reaches an internal-network address or the server itself only if that network is in the Internal networks for proxies, mail, postbacks and task import list (Services and jobs). An internal address from the list is reached directly: by the address — with any way; by a name all of whose addresses are in the list — directly or with your proxy; with Tor — only by the address. The server's external address goes the chosen way;
    • postbacks to hosts of the Internal networks for proxies, mail, postbacks and task import list (Services and jobs) go directly;
    • script databases on an internal network from the Host cơ sở dữ liệu cho scripts list are connected directly (Your own databases).
  • The check for a new Qubix version — directly: the server asks the Qubix image registry whether a new version is out.
  • Qubix's other containers go out on their own, directly: the assistant on a Claude subscription and the certificate container, which gets Let's Encrypt certificates for domains.
  • Docker downloads container images by itself, directly from the server's address: Qubix updates, the Tor image (at every start of the server and every save of this tab while Tor is chosen) and the images of the server's other components, such as the on-box models.
  • Name lookups (DNS). In the SOCKS proxy mode, the server looks up the names of its requests itself (see above). In the Tor mode, the names of the requests that go through Tor are looked up by Tor, but the DNS server that the Qubix server uses still sees the names of the requests that go past the way directly, the names of the domain DNS checks, the names the server checks before a request — the hosts of script databases, for example — and, when the Internal networks for proxies, mail, postbacks and task import list is not empty, the names of postbacks, of mail servers, of Jira and YouTrack servers of the task import and of the SMS operators' APIs. The names of fetch requests go to Tor without it.

Connections without encryption​

Encryption

Through a proxy or Tor, whoever carries a connection can read and change it unless it is encrypted. An http:// address in a script's request or in a postback travels open as far as the proxy or the Tor exit — prefer https:// addresses where you can. A Tor exit is somebody else's server: that is why a script's database on the internet is connected through Tor only when the connection checks the database server — the settings are in Your own databases.

What's next​