Skip to content

Commit

Permalink
Add Proxy support (#395)
Browse files Browse the repository at this point in the history
* Add Proxy support

* move proxy to a class, add socks support

* should use weakSelf

* Move ProxyConnect to Internal/Proxy/SRProxyConnect
  • Loading branch information
oldshuren authored and nlutsenko committed Jun 5, 2016
1 parent c595496 commit d8a3a39
Show file tree
Hide file tree
Showing 4 changed files with 547 additions and 36 deletions.
16 changes: 16 additions & 0 deletions SocketRocket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
3345DC871C52ACD70083CCB8 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6A12CD3145122FC00C1D980 /* Security.framework */; };
3345DC881C52ACD70083CCB8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6B208301450F597009315AF /* Foundation.framework */; };
3345DC8A1C52ACD70083CCB8 /* SRWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = F6A12CCF145119B700C1D980 /* SRWebSocket.h */; settings = {ATTRIBUTES = (Public, ); }; };
4861E7751D022211002FAB1D /* SRProxyConnect.h in Headers */ = {isa = PBXBuildFile; fileRef = 4861E7731D022211002FAB1D /* SRProxyConnect.h */; };
4861E7761D022211002FAB1D /* SRProxyConnect.m in Sources */ = {isa = PBXBuildFile; fileRef = 4861E7741D022211002FAB1D /* SRProxyConnect.m */; };
555E0EB41C51E57A00E6BB92 /* SocketRocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 555E0EB11C51E56D00E6BB92 /* SocketRocket.h */; settings = {ATTRIBUTES = (Public, ); }; };
8105E4801CDD67B400AA12DB /* SRAutobahnTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8105E47A1CDD679A00AA12DB /* SRAutobahnTests.m */; };
8105E4821CDD67BD00AA12DB /* SRTWebSocketOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 8105E4771CDD679A00AA12DB /* SRTWebSocketOperation.m */; };
Expand Down Expand Up @@ -142,6 +144,8 @@
/* Begin PBXFileReference section */
2D4227621BB4358C000C1A6C /* SocketRocket.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SocketRocket.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3345DC901C52ACD70083CCB8 /* SocketRocket.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SocketRocket.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4861E7731D022211002FAB1D /* SRProxyConnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRProxyConnect.h; sourceTree = "<group>"; };
4861E7741D022211002FAB1D /* SRProxyConnect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRProxyConnect.m; sourceTree = "<group>"; };
555E0EB11C51E56D00E6BB92 /* SocketRocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketRocket.h; sourceTree = "<group>"; };
8105E4761CDD679A00AA12DB /* SRTWebSocketOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SRTWebSocketOperation.h; sourceTree = "<group>"; };
8105E4771CDD679A00AA12DB /* SRTWebSocketOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SRTWebSocketOperation.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -272,6 +276,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
4861E7721D022211002FAB1D /* Proxy */ = {
isa = PBXGroup;
children = (
4861E7731D022211002FAB1D /* SRProxyConnect.h */,
4861E7741D022211002FAB1D /* SRProxyConnect.m */,
);
path = Proxy;
sourceTree = "<group>";
};
8105E4741CDD679A00AA12DB /* Tests */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -332,6 +345,7 @@
81B31C0D1CDC404100D86D43 /* Internal */ = {
isa = PBXGroup;
children = (
4861E7721D022211002FAB1D /* Proxy */,
817995831CE139540084DA37 /* Delegate */,
81B31C0E1CDC404100D86D43 /* IOConsumer */,
81B31C5C1CDC443A00D86D43 /* RunLoop */,
Expand Down Expand Up @@ -545,6 +559,7 @@
81B31C1C1CDC404100D86D43 /* SRIOConsumerPool.h in Headers */,
F6A12CD1145119B700C1D980 /* SRWebSocket.h in Headers */,
81B31C2D1CDC406B00D86D43 /* SRHash.h in Headers */,
4861E7751D022211002FAB1D /* SRProxyConnect.h in Headers */,
555E0EB41C51E57A00E6BB92 /* SocketRocket.h in Headers */,
817995861CE139700084DA37 /* SRDelegateController.h in Headers */,
81B22EC51CE42D7E0073C636 /* SRError.h in Headers */,
Expand Down Expand Up @@ -801,6 +816,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4861E7761D022211002FAB1D /* SRProxyConnect.m in Sources */,
81CD05DB1CEEC47300497F47 /* NSURLRequest+SRWebSocket.m in Sources */,
81B22EC91CE42D7E0073C636 /* SRError.m in Sources */,
81B31C181CDC404100D86D43 /* SRIOConsumer.m in Sources */,
Expand Down
18 changes: 18 additions & 0 deletions SocketRocket/Internal/Proxy/SRProxyConnect.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Copyright (c) 2016-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//

#import <Foundation/Foundation.h>

@interface SRProxyConnect : NSObject

-(instancetype)initWithURL:(NSURL *)url;

-(void) openNetworkStreamWithCompletion:(void (^)(NSError *error, NSInputStream *readStream, NSOutputStream *writeStream ))completion;

@end
Loading

0 comments on commit d8a3a39

Please sign in to comment.