5.2

Fixes
* HTTPS from iOS devices, iOS simulators and macOS Safari works again through the tunnel. CFNetwork sends `CONNECT host:443` with `Host: host`, no port, and since 5.0 the local proxy (Jetty 12) answered 400 "Authority!=Host" to every such request; only clients that put the port in the Host header (Android, Chrome, curl) got through, and only traffic relayed by the tunnel server's cache was unaffected. The proxy now accepts a CONNECT whose Host header has no port
* TestCafe works again through the tunnel. TestCafe puts the page URL in its proxy path (`/<session>*<window>/http://site/`), and since 5.0 the local proxy answered 400 "Ambiguous URI empty segment" to every such request, so runs ended in "browser disconnected". The path is relayed unchanged; the origin judges it
* Plain HTTP requests carried two `User-Agent` headers, the client's and Jetty's; only the client's is forwarded now. TestCafe reported the browser as "Other 0.0" because of it

5.1

Faster, steadier traffic through the tunnel server
* Several SSH connections to the tunnel server: `--ssh-connections N` (1-8, default 4). The first keeps the Selenium hub forward and readiness; the others carry browser traffic only and reconnect on their own, so one dropped connection no longer stops traffic. Tunnel servers that spread port 2010 over them do so; on servers that do not, the tunnel falls back to one connection on 2010, as before, after a probe of up to 3 s at startup
* Uploads through the tunnel are up to 10x faster at real-world latency: the window of each forwarded connection is 2 MB instead of JSch's fixed 128 KB, which capped every connection at 128 KB per round trip -- 3 MB/s at 20 ms from the tunnel server, 1.3 MB/s at 50 ms
* A dead SSH session is noticed in about 6 s instead of 15 minutes after a NAT or IP change (VPN reconnect, Wi-Fi switch), and the tunnel reconnects at once
* Port 2010 keeps working through reconnects: a refused reverse forward is retried on the same session instead of tearing down a healthy one, it is requested again after a rebuild, and the server end of the forward is probed so a forward that stopped delivering is repaired

PAC files (`--pac-local`)
* A failover list is honoured: `PROXY a; DIRECT` falls through to the next entry when `a` cannot be reached, on plain HTTP, CONNECT and WebSocket upgrades. 5.0 used only the first entry and answered 502
* `isInNet()` resolves a host name, as browsers and the specification do; it returned false for any name
* The PAC file is loaded before the tunnel is created, so an unparseable file, a digest mismatch or an unpinned http:// URL fails at once instead of after a tunnel server was provisioned

Other
* `--noproxy` without `--localproxy` points the reverse forward at 8087, the port its help text names; it used a random port nothing listened on
* An incomplete API response is reported as one, naming the missing field, instead of as a NullPointerException stack trace
* The tunnel server's warm-up request is no longer logged as two failed requests on every start
* An upstream proxy's rejection is classified by its status code, not by searching the message text, which also contains the proxy's port
* The Windows download is built again; 5.0 shipped without one

5.0

Breaking changes from 4.x
* Requires Java 17 (was 11). The tunnel checks the runtime version itself and reports it plainly instead of failing as "A JNI error has occurred"
* Local listeners bind 127.0.0.1 instead of every interface: the Selenium relay (--se-port), the local proxy (--localproxy), the insight endpoints (--metrics-port) and --web. None of them authenticates, and the relay attaches the account key and secret to everything it forwards. Use `--bind-address 0.0.0.0` to accept connections from other machines
* The Docker image sets TESTINGBOT_BIND_ADDRESS=0.0.0.0, because a loopback bind inside a container makes published ports unreachable; narrow it on the host side of the publish instead
* Successful requests no longer produce a log line. `--log-http` defaults to `errors`; `--log-http url` restores a line per request
* The Selenium relay honours `--log-http` too, where it previously logged every request unconditionally
* Built on Jetty 12's core Handler API with no Servlet layer, which changes the internals for anyone embedding the jar

Restricting what the tunnel can reach
* `--allow-hosts`: name what the tunnel is for and refuse everything else, the inverse of --fast-fail-regexps. Supports `*.suffix` for subdomains
* `--fast-fail-regexps` entries may be prefixed with `!` to make an exception, so `.*,!ok\.com` refuses everything but ok.com and its subdomains. An exception must cover a whole host, so it cannot be satisfied by a name that merely ends with one
* `--localhost-policy deny`: refuse tunnel traffic reaching this machine's loopback. Enforced on the address actually dialled, not only on the name, so a rebinding answer cannot walk past it
* All three are enforced on every way out: plain HTTP, CONNECT and WebSocket upgrades

Egress and upstream proxies
* `--pac-local`: choose egress per destination from a proxy auto-config file, evaluated by a restricted interpreter written for this purpose -- no JavaScript engine is embedded, and unsupported syntax is refused with its line number rather than approximated. `--pac-test` evaluates one URL and exits
* `--pac-local-sha256`: pin the PAC document. A plain http:// PAC URL is refused unless pinned, since its contents decide where traffic and proxy credentials go; redirects are refused rather than followed
* `--proxy-auth-scheme negotiate` with `--proxy-spn`, `--krb5-keytab` and `--krb5-principal`: SPNEGO/Kerberos to the upstream proxy, on all three egress paths
* `--krb5-hosts`: send SPNEGO to named origins as well, for intranet sites that authenticate with Kerberos. An allowlist, never wildcarded
* `--proxy-testingbot` and `--proxy-testingbot-userpwd`: a separate proxy for reaching TestingBot itself. Credentials are not inherited from --proxy-userpwd, and are never sent to a proxy they were not issued for -- including one named by a PAC file
* `--cacert-file`: trust an additional certificate authority, for networks where a proxy intercepts TLS
* `--ws-proxy-mode`: how a ws:// upgrade traverses --proxy, `connect` (default, per RFC 6455) or `get`
* `--connect-to`: dial one host:port for requests naming another, leaving the URL, Host header and TLS SNI untouched
* `--dns-timeout`, `--dns-round-robin`: per-server timeout and round-robin across the --dns list
* `--http-dial-timeout`, `--http-idle-timeout`. The dial timeout also bounds the SSH control connection, which previously had none: a peer that accepted the socket and sent no banner blocked startup and every reconnect
* Upstream proxy credentials are scoped to the whole configured endpoint -- protocol, host and port. CONNECT and WebSocket upgrades compared only the hostname, so a PAC file naming 127.0.0.1 on any other port was sent --proxy-userpwd or the SOCKS5 credentials
* A PAC file is evaluated with the URL the request actually uses, so a rule written on a path is followed by traffic and not only by --pac-test. CONNECT still uses a synthetic https://host:port/, since it carries no path
* A proxy named only by a PAC file receives absolute-form request targets, and a PAC DIRECT answer sends origin-form even when --proxy is configured
* The API client authenticates to the upstream proxy with Negotiate when --proxy-auth-scheme negotiate is set. It only ever sent username and password, so on a proxy requiring Kerberos the tunnel could not register at all

Observability
* `--log-http`: per-request logging at `none`, `url`, `headers` or `errors`, settable per module (`proxy:`, `forwarder:`). `forwarder:body` logs the Selenium relay's request body with credentials redacted by key
* `--log-format json`: one object per record, so a collector need not guess where a stack trace ends
* `--request-id-header`: correlation id on every request, reusing an incoming value
* `/healthz` and `/readyz` on the metrics port, and `--ready` to query a running tunnel and exit 0 or 1
* `--doctor` diagnoses the configuration it was actually given, including the whole Kerberos chain and any --cacert-file subjects

Embedding the tunnel in another application
* `App.awaitReady(Duration)` and `App.getSetupFailure()`: boot() returns once the tunnel is created, which is not the same as it being able to carry traffic, and a caller had nothing to wait on but its own polling loop
* Readiness is per tunnel: two tunnels in one JVM each answer for themselves on their own metrics port, where /readyz previously answered from a process-wide gauge for whichever wrote last -- and stopping one reported the other as down
* stop() restores the JVM's default Authenticator and forgets the SOCKS credentials it registered, so a stopped tunnel's proxy password is no longer offered for the rest of the process's life, and a tunnel per job no longer stacks one authenticator per job
* The startup self-test asks the API it was configured with rather than naming api.testingbot.com literally, so an embedder pointing at another endpoint is not failed by its own diagnostic
* The new-version notice is logged rather than written to the host application's stderr

Other
* `--config`: read options from a file. Every long option also has a TESTINGBOT_* environment alias derived from its name; precedence is command line, then config file, then environment
* `--header` and `--response-header`: add, replace or remove headers on plain HTTP
* `--nobump-domains`: disable SSL bumping for named hosts only
* `--ssh-host-key`: pin the SHA-256 fingerprint the tunnel server's SSH host key must have. The API's fingerprint is used when it supplies one, and a pin given here outranks it. Without either the connection is unverified, as before, but says so on every connect and in --doctor; `--ssh-host-key-policy require` refuses to connect instead. A fingerprint the API sends that cannot be parsed is now fatal rather than ignored
* A boolean set to false in a --config file is no longer overridden by the environment. `shared=false` with TESTINGBOT_SHARED=true produced a shared tunnel
* A failed startup self-test is retried while SSH stays connected, so a check that failed for a transient reason no longer leaves a healthy tunnel reporting 503 forever. The external loopback callback test is skipped, rather than failed, when --localhost-policy deny, --allow-hosts, --fast-fail-regexps, --connect-to or --pac-local would legitimately refuse it, and it now honours --proxy-testingbot and --cacert-file
* A reconnect reports ready only once both forwarding directions are established; a server that authenticated and then refused the reverse forward used to advertise a tunnel that could carry nothing
* A queued reconnect no longer fires after shutdown: stop() cancels the reconnect monitor, and every step of a retry checks it
* Request URLs are redacted in logs -- userinfo and credential-shaped query values -- and TB-Credentials is treated as a sensitive header
* Example Prometheus + Grafana stack publishes on loopback and requires an admin password to be supplied

4.8
* Prometheus `/metrics` endpoint on the existing metrics port, exposing HTTP request rate/duration/size histograms, HTTPS CONNECT counters + handshake duration, SSH tunnel state and reconnects, active connections, error counters, and bundled JVM/process metrics
* New `--metrics-auth user:password` flag (and `TESTINGBOT_METRICS_AUTH` env var) for optional HTTP Basic auth on `/metrics`
* Environment variable alternatives for credential-bearing flags to keep secrets out of `ps`: `TESTINGBOT_AUTH`, `TESTINGBOT_PROXY_USERPWD`, `TESTINGBOT_METRICS_AUTH`
* `examples/docker-compose-prometheus-grafana/` and `examples/grafana-dashboard/`: a ready-to-run Prometheus + Grafana stack with a pre-built dashboard
* Strip sensitive headers from debug logging
* Improve basic auth handling
* Improve logging
* Update dependencies

4.7
* Fix Websocket issue
* Update dependencies

4.6
* Fix issue where --debug mode was used by default

4.5
* Update dependencies
* Introduce `-s` or `--shared` flag to indicate you want to share the tunnel with colleagues on TestingBot. By default, a tunnel is *not shared*.
* Code improvements

4.4
* Update dependencies
* Improved `--proxy` and `--proxy-userpwd` handling

4.3
* Update dependencies (Jetty + SSH lib)
* Improve monitoring + retry mechanisms
* Drop support for JDK 8
* Improve `--doctor` checks

4.0
* Update dependencies (Jetty 11)
* Websocket + Server Sent Events support
* Introduced --nobump argument to disable SSL bumping

3.5
* Update SSH library, no longer use blowfish as default cipher

3.4
* Revert dependencies update

3.3
* Update Dependencies
* Show warning when Tunnel is unable to reach upstream

3.2
* Update Dependencies

3.1
* Update Dependencies
* Fix tunnel poller, polling indefinitely

3.0
* Optimize logging
* Docker version
* Add Proxy Support

2.9
* Various minor fixes (timeouts, doctor checks, ..)

2.8
* Fix NPE in CONNECT handling

2.7
* Rename jettyport option to localport
* If started with --nocache, send to API for Manual Testing
* Implemented upstream proxying for HTTPs via CONNECT (--proxy)
* Updated pom.xml dependencies
* No more hardcoded ports to listen to

2.6
* Update pom.xml dependencies
* Remove incorrect Java version check
* Remove deprecated features: --boost and --ssl
* Add option to supply extra HTTP headers during requests
* Add option to supply basic auth credentials for various hosts, which the tunnel will automatically use
* Make the --nocache option clearer: Do not cache any HTTP requests

2.5
* Send Tunnel version to TestingBot
* Add Proxy PAC support

2.4
* Add --tunnel-identifier to identify different tunnels for the same account
* Improved logging (formatting, log to file, debug levels, ...)
* Improved handling of connection errors (re-establish connection to tunnel VM upon connection failures)
* Added option where you can specify a local directory to be set up as a webserver, for example to test static files
* Added an embedded statistics REST api to fetch details about the running instance, by default runs on port 8003

2.3
* Add --doctor to troubleshoot misconfigurations
* Update pom.xml dependencies
* Debugmode will now output HTTP headers
* Cleanup: remove unused imports and code

2.2
* Fix the fast-fail domain blacklist feature to work with the new Jetty 9 proxies

1.14
* remove region
* update dependencies

1.11
* ssh compression (zlib)

1.10
* switch to using blowfish tunnel encryption which should be faster
* improved error logging
* display how long each proxied request takes in ms
* add rabbIT support

1.9
* remove readyfile when tunnel is stopped
* cleanup code
* re-try establishing SSH connection when it fails
* test forwarding + tunnel upon starting, will show a warning message if something is not working properly.

1.8:
* Improved error handling, updated Jetty from 7.4.5.v20110725 to 8.1.9.v20130131, which fixes an issue where a HTTP method would sometimes be wrongly proxied.

1.7:
* Added region support, use -r to specify if you want the tunnel to be used on our US or EU cloud.

1.6:
* Added support for running multiple tunnels under the same account.
  This allows for spreading the load across multiple machines when running a high number of simultaneous tests.
