Skip to main content

Listening Ports and ports.json

· 6 min read
Lessica
Maintainer of XXTouch Elite

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.json
{
"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

KeyTransportDefaultUsed by
http_portTCP46952OpenAPI, built-in web interface, IDE communication, and internal HTTP clients
discovery_portUDP46953XXTouch Elite device discovery and Control Center searches
legacy_discovery_portUDP14099TouchSprite and TouchElf-compatible discovery
logging_udp_portUDP46956Internal script log receiver, including nLog network output
logging_websocket_portTCP46957Live log WebSocket used by the log and script editor pages
webdav_portTCP80WebDAV file service
remote_control_portTCP46968Real-time screen and remote-control WebSocket
control_center_portTCP46969Control Center WebSocket, including its web and script clients
control_center_udp_portUDP35452Control 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 1 through 65535.
  • 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.
note

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.js and use the resolved values for their HTTP and WebSocket connections. /ports.js is a generated client configuration endpoint, not a file to edit.
  • The former GET /network_config.js route is no longer registered. Web integrations must use GET /ports.js.
  • The legacy /var/mobile/Media/1ferver/1ferver.conf HTTP port is generated from http_port. Do not edit 1ferver.conf to 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.