Skip to content

Connecting to a proxy server

Bùi Minh Đức edited this page Nov 8, 2024 · 1 revision

KaiOS supports connecting and routing web traffic through a proxy server, which can be helpful in some situations.

Before you start, turn on debugging mode on your phone, and have a computer with ADB and WebIDE ready. On the 6300 4G and 8000 4G, you may have to root your phone before you can open the Device Preferences page in WebIDE.

For Browser app only (system.gaiamobile.org)

Connect your phone to WebIDE, and sideload either CrossTweak or Wallace Toolbox. In the main menu, press 8 to configure the host address and port number, which the app will validate for you. Press 7 to turn the connection on or off.

Alternatively, you can open Device Settings or Device Preferences in the right sidebar, and search for these keys. If they don’t exist, create them with the appropriate types:

name type default description

network.proxy.browsing.enabled

Boolean

N/A

Turn proxy connection on or off

network.proxy.browsing.host

String

N/A

Host address of the proxy server, e.g., 192.168.1.25

network.proxy.browsing.port

Integer

N/A

Port number of the proxy server, e.g., 8080

network.proxy.browsing.app_origins

String

app://system.gaiamobile.org

Config which apps can use this proxy; app URIs are separated by commas (Device Preferences only)

A proxy connection should start up right away without you having to restart your phone.

For all apps (system-wide)

Open Device Preferences in the right sidebar, search and fill in these keys:

name type default description ref

network.proxy.(protocol)

String

''

Host address of the proxy server, e.g., 192.168.1.25

network.proxy.(protocol)_port

Integer

0

Port number of the proxy server, e.g., 8080

a

Depending on which protocols your proxy server supports, protocol can be either http, ftp, socks or ssl.

Once you’re done, reboot the phone (or restart B2G by doing a Deep Memory Cleaning) for the changes to take effect.

When I used mitmproxy to monitor the Internet traffic over SOCKS5, I set network.proxy.socks to my computer’s IPv4 address on the local network, and network.proxy.socks_port to whatever port mitmproxy opened, 8080 by default.

Configuration

Domain whitelist

name type default description ref

network.proxy.no_proxies_on

String

localhost, 127.0.0.1

Domains and addresses to connect directly instead of through proxy; separated by commas

b

Automatic proxy configuration

name type default description ref

network.proxy.type

Integer

2

0: no proxy
1: manual proxy configuration
2: automatic proxy configuration
4: auto-detect proxy settings
5: use system proxy settings

c

network.proxy.autoconfig_url

String

see below

Points to a central PAC file which you can use to manage proxy settings for a network or organization

d

data:text/plain,function FindProxyForURL(url, host) { if (shExpMatch(host, 'localhost') || shExpMatch(host, '127.0.0.1')) { return 'DIRECT'; } return 'DIRECT'; }