web developer tool and proxy utility for iOS 9

Surge is a web developer tool and proxy utility for iOS 9. This app is designed for developers and may require some level of professional knowledge to use.


  • Capture all HTTP/HTTPS/TCP traffic from any applications on your device, and redirect the traffic to an HTTP/HTTPS/SOCKS5 proxy server following highly configurable rules;
  • Override system DNS settings even on cellular network. And boost performance by sending DNS query to all DNS servers simultaneously.
  • Record and display HTTP request and response header sent from your iOS devices;
  • Configure rules using domain match, domain suffix, domain keyword, CIDR IP range, and/or GeoIP lookup;
  • Measure traffic usage and network speed on WiFi, cellular, and proxy connections.
  • Import rules from URL or iTunes File Sharing;
  • High performance and suitable for intensive use;
  • Block ads by domain rules;
  • Work on cellular network.

Known Issues

  • It is unable to view request and response body. This feature will be added in a future update soon.
  • The HTTP/HTTPS proxy server must support CONNECT method, even when accessing plain HTTP resources.
  • HTTP pipelining is not supported.
  • IPv6 is not supported.
  • SOCKS5 authentication is not supported.
  • There might be a little inaccuracy in traffic usage statistics while using an HTTPS proxy.
  • HTTPS and raw TCP traffic cannot be inspected.
  • Only TCP based protocol is supported.


There are two main components in Surge: Surge proxy server and Surge TUN interface.

After started, Surge sets itself as the default HTTP/HTTPS proxy server to handle all HTTP/HTTPS traffic, which allows Surge to boost performance by using HTTP connections’ keep-alive mechanism globally. But some apps do not obey system proxy setting (such as Mail.app), because they need to use a raw TCP socket. This kind of traffic is handled by Surge TUN interface.

web developer tool and proxy utility for iOS 9

Currently, Surge TUN interface can only process TCP protocol. Other protocol packet (such as UDP, ICMP) will be dropped. You can use ‘bypass-tun’ option as a workaround.


General Section

loglevel = verbose
bypass-system = true
skip-proxy =,,, localhost, *.local
bypass-tun =,,
dns-server =,

loglevel (Default: notify)

One of verbose, info, notify or warning. It’s not recommended to enable verbose in daily use because this will slow down performance significantly.


This option will add some special rules. First, these rules below are added to allow domains to bypass Surge proxy server and use raw TCP:


Second, this rule is added with the highest priority:

IP-CIDR,, DIRECT, no-resolve

If you disable this option, it may lead to some system problems, such as delays in push notifications.

Notice: Entire address block is assigned to Apple.


This option forces connections to these domain/IP ranges to be handled by Surge TUN interface, instead of Surge proxy server. This option is used to fix some compatibility problems with some apps.

  • To specify a single domain, enter the domain name – for example, apple.com.
  • To specify all websites on a domain, use an asterisk before the domain name – for example, *apple.com.
  • To specify a specific part of a domain, specify each part – for example, store.apple.com.
  • To specify hosts or networks by IP addresses, enter a specific IP address such as or an address range, such as 192.168.2.* or

Notice: If you enter an IP address or address range, you are only able to bypass the proxy when you connect to that host using that address, not when you connect to the host by a domain name that resolves to that address.


Surge TUN interface can only process TCP protocol. Use this option to bypass specify IP ranges to allow other protocols to pass through.

Notice: This option only works for Surge TUN interface. Request handled by Surge Proxy Server will not be affected. Combine ‘skip-proxy’ and ‘bypass-tun’ to make sure that certain HTTP traffic bypasses Surge.


You can override the default DNS server with this option. iOS system does not allow you to modify DNS settings on cellular network. With Surge now you can achieve this easily.

To boost performance Surge will send DNS queries to all DNS servers defined in the config simultaneously. The query will be retried every 2 seconds if no response is received, up to 5 times.

Proxy Section

Surge supports HTTP, HTTPS, and SOCKS5 proxy server. Example:

ProxyA = socks5, example.server.com, 3129
ProxyB = http, example.server.com, 3128
ProxyC = https, example.server.com, 443, username, password

You can create multiple proxies for different rules.

  • Currently only HTTP/HTTPS proxy supports authentication. The username and password are optional.

  • You can force Surge to use a specific HTTPS cipher for HTTPS proxy. Ciphers in GCM mode are recommended to reduce memory usage and improve performance. See config interface for available values.

ProxyC = https, example.server.com, 443, username, password, cipher=TLS_RSA_WITH_AES_128_GCM_SHA256
  • TLS session resumption: TLS False Start and Explicit Congestion Notification are enabled by default for HTTPS proxy, to improve performance. There will be options to turn them off in the future.

Rule Section

Rules are matched from the first one to the last one, in the order they appear in the config file. In other words, rules in front have higher priority than rules in the back.



Surge supports 6 different types of rule. Each rule consists of 3 parts: rule type, a traffic matcher (except for FINAL rule), and a proxy policy. Rule type is one of DOMAIN, DOMAIN-SUFFIX, DOMAIN-KEYWORD, GEOIP, IP-CIDR, or FINAL. Proxy policy must be one of a proxy name, DIRECT, or REJECT.



Rule matches if the domain of request matches exactly.



Rule matches if the domain of the request matches the suffix. For example: ‘google.com’ matches ‘www.google.com’, ‘mail.google.com’ and ‘google.com’, but does not match ‘content-google.com’.



Rule matches if the domain of the request contains the keyword.


Rule matches if the IP address of the request matches the specified range.



Rule matches if the GeoIP test result matches the specified country code.



Rule section must end with a FINAL statement, to specify the default policy.

Option: no-resolve


When a GEOIP or IP-CIDR rule is encountered, Surge will send a DNS query if the hostname of request is a domain. You can specify ‘no-resolve’ option to skip this rule for a request with domain.

Option: force-remote-dns


When a raw TCP connection is handled by Surge TUN interface, the application will try to resolve the domain at first, then send packets to the IP address directly. If the domain can not be resolved locally,you can use this option to force the DNS resolution to happen remotely on the proxy.

Technically, when an application tries to resolve a domain which matches a rule with ‘force-remote-dns’ option. Surge will send a DNS answer with a fake IP address (240.1.x.x). When the application connects to the fake IP, Surge will remap it to a domain and send the request to the remote proxy.

Notice: This option only works for Surge TUN interface. Request handled by Surge Proxy Server will always be resolved in remote if the policy of rule is a proxy.

Protected Configuration

If a configuration file starts with #!REQUIRE-PROTECTED, Surge will mark this configuration file as protected, which prevents users from viewing or editing the configuration file. This is useful when you share your own proxy server with others.

URL Scheme

Surge supports 3 actions and one option.


  • surge:///start

    Start with selected configuration

  • surge:///stop

    Stop current session

  • surge:///toggle

    Start or stop with selected configuration


  • autoclose=true

    Auto close Surge after action completed.

    Example: surge:///toggle?autoclose=true


上一篇 2016年3月17日 14:34
下一篇 2016年3月31日 18:43



您的电子邮箱地址不会被公开。 必填项已用 * 标注