Abbreviate `ice` list in bridge lines
In tpo/applications/tor-browser-build#40665 (closed) we had a problem with snowflake bridge lines being too long.
As a mitigation we can abbreviate the largest part of the line, the ice
list of STUN servers,
by omitting the stun:
scheme, and the port number when it is 3478.
A current bridge line is 500 bytes (counting only the part after the bridge fingerprint, which is what counts):
fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://snowflake-broker.torproject.net.global.prod.fastly.net/ front=cdn.sstatic.net ice=stun:stun.l.google.com:19302,stun:stun.altar.com.pl:3478,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.sonetel.net:3478,stun:stun.stunprotocol.org:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn
The ice
part is 324 bytes, or 65%. We can shorten that to 209 bytes by abbreviating the entries as proposed above. That reduces the total length by 115 bytes, or 23%.
fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://snowflake-broker.torproject.net.global.prod.fastly.net/ front=cdn.sstatic.net ice=stun.l.google.com:19302,stun.altar.com.pl,stun.antisip.com,stun.bluesip.net,stun.dus.net,stun.epygi.com,stun.sonetel.com,stun.sonetel.net,stun.stunprotocol.org,stun.uls.co.za,stun.voipgate.com,stun.voys.nl utls-imitate=hellorandomizedalpn
To make this work, we need to have the parser supply defaults for the scheme and port of each STUN URL if not specified.
Discussion from the 2022-10-27 team meeting:
http://meetbot.debian.net/tor-meeting/2022/tor-meeting.2022-10-27-15.59.log.html#l-95