File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ const handle = async (ctx: Context): Promise<void> => {
30
30
longitude : probe . location . longitude ,
31
31
asn : probe . location . asn ,
32
32
network : probe . location . network ,
33
+ isIPv4Supported : probe . isIPv4Supported ,
34
+ isIPv6Supported : probe . isIPv6Supported ,
33
35
} ;
34
36
} ;
35
37
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ const getProbeIp = (socket: Socket) => {
12
12
13
13
// Use random ip assigned by the API
14
14
if ( process . env [ 'FAKE_PROBE_IP' ] ) {
15
+ // Use fake ip provided by the probe if exists
16
+ if ( socket . handshake . query [ 'fakeIp' ] ) {
17
+ return socket . handshake . query [ 'fakeIp' ] as string ;
18
+ }
19
+
15
20
const samples = [
16
21
'131.255.7.26' , // Buenos Aires
17
22
'213.136.174.80' , // Naples
@@ -30,11 +35,6 @@ const getProbeIp = (socket: Socket) => {
30
35
return samples [ index ] ;
31
36
}
32
37
33
- // Use fake ip provided by the probe
34
- if ( process . env [ 'TEST_MODE' ] === 'perf' ) {
35
- return socket . handshake . query [ 'fakeIp' ] as string ;
36
- }
37
-
38
38
const clientIp = requestIp . getClientIp ( socket . request ) ;
39
39
40
40
if ( ! clientIp ) {
You can’t perform that action at this time.
0 commit comments