File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -60,3 +60,11 @@ proxyServer.start();
60
60
61
61
// When finished
62
62
proxyServer . close ( ) ;
63
+
64
+ AnyProxy . utils . systemProxyMgr . enableGlobalProxy ( '127.0.0.1' , 8080 ) ;
65
+ AnyProxy . utils . systemProxyMgr . enableGlobalProxy ( '127.0.0.1' , 8080 , 'http' ) ;
66
+ AnyProxy . utils . systemProxyMgr . enableGlobalProxy ( '127.0.0.1' , 8080 , 'https' ) ;
67
+
68
+ AnyProxy . utils . systemProxyMgr . disableGlobalProxy ( ) ;
69
+ AnyProxy . utils . systemProxyMgr . disableGlobalProxy ( 'http' ) ;
70
+ AnyProxy . utils . systemProxyMgr . disableGlobalProxy ( 'https' ) ;
Original file line number Diff line number Diff line change 1
1
// Type definitions for anyproxy 4.1
2
2
// Project: https://github.com/alibaba/anyproxy
3
3
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
4
+ // Roland Reed <https://github.com/roland-reed>
4
5
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6
6
7
/// <reference types="node" />
@@ -21,6 +22,8 @@ import {
21
22
22
23
export type MaybePromise < T > = T | Promise < T > ;
23
24
25
+ export type NetworkType = 'http' | 'https' ;
26
+
24
27
export interface ProxyOptions {
25
28
/** Port number of proxy server */
26
29
port : string | number ;
@@ -229,9 +232,9 @@ export namespace utils {
229
232
/** Manage the system proxy config. sudo password may be required. */
230
233
namespace systemProxyMgr {
231
234
/** Enable global system proxy with specified params. sudo password may be required. */
232
- function enableGlobalProxy ( host : string , port : string | number ) : void ;
235
+ function enableGlobalProxy ( host : string , port : string | number , networkType ?: NetworkType ) : void ;
233
236
/** Disable global system proxy. sudo password may be required. */
234
- function disableGlobalProxy ( ) : void ;
237
+ function disableGlobalProxy ( networkType ?: NetworkType ) : void ;
235
238
}
236
239
237
240
/** Manage certificates of AnyProxy. */
You can’t perform that action at this time.
0 commit comments