forked from haxpor/Potatso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProxyManager.h
32 lines (27 loc) · 1.03 KB
/
ProxyManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// ProxyManager.h
// Potatso
//
// Created by LEI on 2/23/16.
// Copyright © 2016 TouchingApp. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void(^SocksProxyCompletion)(int port, NSError *error);
typedef void(^HttpProxyCompletion)(int port, NSError *error);
typedef void(^ShadowsocksProxyCompletion)(int port, NSError *error);
extern int sock_port (int fd);
@interface ProxyManager : NSObject
+ (ProxyManager *)sharedManager;
@property (nonatomic, readonly) BOOL socksProxyRunning;
@property (nonatomic, readonly) int socksProxyPort;
@property (nonatomic, readonly) BOOL httpProxyRunning;
@property (nonatomic, readonly) int httpProxyPort;
@property (nonatomic, readonly) BOOL shadowsocksProxyRunning;
@property (nonatomic, readonly) int shadowsocksProxyPort;
- (void)startSocksProxy: (SocksProxyCompletion)completion;
- (void)stopSocksProxy;
- (void)startHttpProxy: (HttpProxyCompletion)completion;
- (void)stopHttpProxy;
- (void)startShadowsocks: (ShadowsocksProxyCompletion)completion;
- (void)stopShadowsocks;
@end