Listening Ports and ports.json
XXTouch Elite uses one optional JSON file to configure the listening ports of its built-in network services. The file is absent by default, so a normal installation continues to use the historical default ports without any additional setup.
Configuration file
The canonical configuration path is:
/var/mobile/Media/1ferver/conf/ports.json
On standard jailbreak installations, the same file is also exposed at:
/usr/local/xxtouch/etc/ports.json
These paths refer to the same configuration. Do not maintain separate copies.
ports.json is deliberately not installed as a package conffile and does not exist on a default installation. When the file is absent, unreadable, or not valid JSON, every service uses its default port.
ports.json is the only supported port configuration file. Older development snapshots may have referred to network.json; that name is no longer read.
An example is installed in the same directory as ports.example.json. Copy it to ports.json, then edit the copy. Do not rename or modify the example file itself.
File format
The recommended format is the same as the installed example:
{
"ports": {
"http_port": 46952,
"discovery_port": 46953,
"legacy_discovery_port": 14099,
"logging_udp_port": 46956,
"logging_websocket_port": 46957,
"webdav_port": 80,
"remote_control_port": 46968,
"control_center_port": 46969,
"control_center_udp_port": 35452
}
}
You may omit keys that do not need to change. Omitted keys use their default values. For compatibility, the known keys may also be placed directly in the root object, but new configurations should use the nested ports object shown above. If a ports object is present, port keys outside it are ignored.
The file must be strict JSON: comments, trailing commas, hexadecimal numbers, and expressions are not supported.
Port reference
| Key | Transport | Default | Used by |
|---|---|---|---|
http_port | TCP | 46952 | OpenAPI, built-in web interface, IDE communication, and internal HTTP clients |
discovery_port | UDP | 46953 | XXTouch Elite device discovery and Control Center searches |
legacy_discovery_port | UDP | 14099 | TouchSprite and TouchElf-compatible discovery |
logging_udp_port | UDP | 46956 | Internal script log receiver, including nLog network output |
logging_websocket_port | TCP | 46957 | Live log WebSocket used by the log and script editor pages |
webdav_port | TCP | 80 | WebDAV file service |
remote_control_port | TCP | 46968 | Real-time screen and remote-control WebSocket |
control_center_port | TCP | 46969 | Control Center WebSocket, including its web and script clients |
control_center_udp_port | UDP | 35452 | Control Center discovery response receiver |
Only the keys in this table are configurable through ports.json. Other ports used by iOS, the jailbreak environment, SSH, or third-party software are outside the scope of this file.
Validation and fallback rules
Native services and built-in Lua components resolve the file independently using the same rules. Web clients receive the effective values from /ports.js, so listeners and bundled clients remain consistent.
- A value must be a JSON integer from
1through65535. - Boolean values, strings, fractions, zero, negative values, and out-of-range values are rejected.
- Unknown keys are ignored.
- A missing or invalid value falls back to the default for that key; it does not prevent other valid values from taking effect.
- If the entire document cannot be decoded, every key falls back to its default.
- Two configured services may not use the same port on the same transport. Every key involved in a TCP-to-TCP or UDP-to-UDP collision falls back to its own default, and the result is checked again until no collision remains.
TCP and UDP have separate port namespaces. Reusing the same number once for TCP and once for UDP is not considered a collision, although doing so may still be confusing to operators.
Changing the ports
You can create and edit the file with Filza, SFTP, or an SSH session. The following SSH commands copy the installed example and set conventional ownership and permissions:
cp /var/mobile/Media/1ferver/conf/ports.example.json \
/var/mobile/Media/1ferver/conf/ports.json
chown mobile:mobile /var/mobile/Media/1ferver/conf/ports.json
chmod 0644 /var/mobile/Media/1ferver/conf/ports.json
Edit only the values that need to change. Before applying the configuration, save any work on the device: a user-space restart closes applications and disconnects the current SSH session.
On jailbreak environments that provide jbctl, apply the change with:
jbctl reboot_userspace
A full device reboot also applies the change.
Runtime reload is not supported. Editing ports.json does not change the ports of already running services or clients; restarting only a browser page is not sufficient.
Effects on clients and integrations
The setting covers both listeners and the built-in clients that connect to them:
- Built-in Lua components use the resolved HTTP, discovery, logging, remote-control, and Control Center ports.
- The built-in web pages load
GET /ports.jsand use the resolved values for their HTTP and WebSocket connections./ports.jsis a generated client configuration endpoint, not a file to edit. - The former
GET /network_config.jsroute is no longer registered. Web integrations must useGET /ports.js. - The legacy
/var/mobile/Media/1ferver/1ferver.confHTTP port is generated fromhttp_port. Do not edit1ferver.confto change the listening port. - Discovery responses advertise the resolved HTTP port, allowing compatible IDE and Control Center clients to connect to the correct endpoint.
- External clients with a manually entered URL or port—such as an OpenAPI integration, reverse proxy, firewall rule, or SSH tunnel—must still be updated by their operator.
For example, after changing http_port to 47152, the web interface and OpenAPI base URL become:
http://<device-ip>:47152/
The WebDAV, live-log, real-time screen, and Control Center endpoints likewise move to their configured ports.
Verifying the effective configuration
After the device or user space has restarted, retrieve the generated web-client configuration from the resolved HTTP port:
curl http://<device-ip>:<http_port>/ports.js
The response assigns the effective values—including any defaults selected by validation—to window.XXTNetworkPorts. Opening the built-in log, real-time screen, or Control Center page also exercises the corresponding browser client with those values.
To restore every default, remove the custom file and restart the device or user space:
rm /var/mobile/Media/1ferver/conf/ports.json
jbctl reboot_userspace
Changing a port is not an access-control mechanism. XXTouch Elite's remote-access settings and any network-level firewall policy continue to determine which peers may use a service.
