@@ -131,6 +131,78 @@ class RelayTests: LoggedInWithTimeUITestCase {
131
131
. tapCancelButton ( )
132
132
}
133
133
134
+ func testWireGuardOverTCPCustomPort80( ) throws {
135
+ addTeardownBlock {
136
+ HeaderBar ( self . app)
137
+ . tapSettingsButton ( )
138
+
139
+ SettingsPage ( self . app)
140
+ . tapVPNSettingsCell ( )
141
+
142
+ VPNSettingsPage ( self . app)
143
+ . tapWireGuardObfuscationExpandButton ( )
144
+ . tapWireGuardObfuscationOffCell ( )
145
+ }
146
+
147
+ HeaderBar ( app)
148
+ . tapSettingsButton ( )
149
+
150
+ SettingsPage ( app)
151
+ . tapVPNSettingsCell ( )
152
+
153
+ VPNSettingsPage ( app)
154
+ . tapWireGuardObfuscationExpandButton ( )
155
+ . tapWireGuardObfuscationUdpOverTcpCell ( )
156
+ . tapUDPOverTCPPortSelectorButton ( )
157
+
158
+ UDPOverTCPObfuscationSettingsPage ( app)
159
+ . tapPort80Cell ( )
160
+ . tapBackButton ( )
161
+
162
+ VPNSettingsPage ( app)
163
+ . tapBackButton ( )
164
+
165
+ SettingsPage ( app)
166
+ . tapDoneButton ( )
167
+
168
+ // The packet capture has to start before the tunnel is up,
169
+ // otherwise the device cannot reach the in-house router anymore
170
+ startPacketCapture ( )
171
+
172
+ TunnelControlPage ( app)
173
+ . tapConnectButton ( )
174
+
175
+ allowAddVPNConfigurationsIfAsked ( )
176
+
177
+ TunnelControlPage ( app)
178
+ . waitForConnectedLabel ( )
179
+
180
+ let connectedToIPAddress = TunnelControlPage ( app)
181
+ . tapRelayStatusExpandCollapseButton ( )
182
+ . getInIPv4AddressLabel ( )
183
+
184
+ try Networking . verifyCanAccessInternet ( )
185
+
186
+ let targetIPAddress = Networking . getAlwaysReachableIPAddress ( )
187
+ let trafficGenerator = TrafficGenerator ( destinationHost: targetIPAddress, port: 80 )
188
+ trafficGenerator. startGeneratingUDPTraffic ( interval: 0.1 )
189
+
190
+ RunLoop . current. run ( until: . now + 1 )
191
+ trafficGenerator. stopGeneratingUDPTraffic ( )
192
+
193
+ TunnelControlPage ( app)
194
+ . tapDisconnectButton ( )
195
+ let capturedStreams = stopPacketCapture ( )
196
+
197
+ let streamFromPeeerToRelay = try XCTUnwrap (
198
+ capturedStreams
199
+ . filter { $0. destinationAddress == connectedToIPAddress } . first
200
+ )
201
+
202
+ XCTAssertTrue ( streamFromPeeerToRelay. destinationPort == 80 )
203
+ XCTAssertTrue ( streamFromPeeerToRelay. transportProtocol == . TCP)
204
+ }
205
+
134
206
func testWireGuardOverTCPManually( ) throws {
135
207
addTeardownBlock {
136
208
HeaderBar ( self . app)
0 commit comments