Giter Site home page Giter Site logo

proxykit's Introduction

Build Status Version Platform

Objective-C SOCKS 5 / RFC 1928 proxy server and socket client libraries built upon GCDAsyncSocket.

Usage

SOCKSProxy - Dead simple SOCKSv5 proxy server for OS X or iOS. Supports acting as background "VoIP" sockets on iOS via GCDAsyncSocket.

SOCKSProxy *proxy = [[SOCKSProxy alloc] init];
[proxy startProxyOnPort:9050];

GCDAsyncProxySocket - Proxy-compatible subclass and drop-in replacement for (most of) GCDAsyncSocket.

GCDAsyncProxySocket *socket = [[GCDAsyncProxySocket alloc] init];
[socket setProxyHost:@"127.0.0.1" port:9050 version:GCDAsyncSocketSOCKSVersion5];
[socket connectToHost:@"example.com" onPort:80 error:nil];

For more documentation check out ProxyKit on Cocoadocs.

Installation

We use Cocoapods. There are two subspecs for the server and client code. By default both are included. Put one of these your Podfile:

pod 'ProxyKit'    
pod 'ProxyKit/Server' # Just the server code
pod 'ProxyKit/Client' # Just the client code

To install:

$ pod install

Tests

You can run tests by opening up ProxyKit.xcworkspace after installing the Pods.

Dependencies

  • GCDAsyncSocket - GCD-based Async Objective-C socket library
  • CocoaLumberjack - A fast & simple, yet powerful & flexible logging framework for Mac and iOS

Apps Using This Library

  • Tether - Tethering for non-jailbroken iOS Devices over USB.
  • ChatSecure - free and open source encrypted chat client for iPhone and Android that supports OTR encryption over XMPP.

TODO

  • Better documentation
  • More tests

Contributing

Thank you for your interest in contributing to ProxyKit! Check out the TODO for things that still need to be done.

  1. Fork the project and work in a feature branch.
  2. Ensure that the existing tests are passing and/or write more tests.
  3. Open a pull request on GitHub.
  4. Thank you!

Author

Chris Ballinger

License

MIT

proxykit's People

Contributors

chrisballinger avatar davidchiles avatar rainwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxykit's Issues

Usage in VOIP app

I saw in readme says:

SOCKSProxy - Dead simple SOCKSv5 proxy server for OS X or iOS. Supports acting as background "VoIP" sockets on iOS via GCDAsyncSocket.

I use PJSIP implement a sip client. And I have no idea how to use Proxykit in this case. I try google, but there is nothing about how to use.

My login method.

- (void)login:(NSString *)server account:(NSString *)username  pwd:(NSString *)password {
    
    
    pjsua_acc_id acc_id;
    pjsua_acc_config cfg;
    
    pjsua_acc_config_default(&cfg);
    cfg.id = pj_str((char *)[NSString stringWithFormat:@"sip:%@@%@", username, server].UTF8String);
    cfg.reg_uri = pj_str((char *)[NSString stringWithFormat:@"sip:%@", server].UTF8String);
    cfg.reg_retry_interval = 0;
    cfg.cred_count = 1;
    cfg.cred_info[0].realm = pj_str("*");
    cfg.cred_info[0].username = pj_str((char *)username.UTF8String);
    cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
    cfg.cred_info[0].data = pj_str((char *)password.UTF8String);
    
    pj_status_t status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);
    
    if (status != PJ_SUCCESS) {
        NSString *errorMessage = [NSString stringWithFormat:@"Login fail Error code:%d!", status];
        NSLog(@"register error: %@", errorMessage);
    }
}

Can anyone help me?

Expected umbrella, header, submodule, or module export, could not build module

I have two errors during building:
1)
CocoaLumberjack.framework/Modules/module.modulemap:7:2: error: expected umbrella, header, submodule, or module export
textual header "DDLogMacros.h"
^

Pods/ProxyKit/ProxyKit/Client/GCDAsyncProxySocket.m:11:9: fatal error: could not build module 'CocoaLumberjack'
@import CocoaLumberjack;

XCode 6.2
Build-target: os x 10.9

Tell me please, what's wrong.

Some Bugs in source code

In the SOCKSProxySocket.m source file, when convert address (such as line 192) to NSString, the parameter length passed to initWithBytesNoCopy:length:encoding:freeWhenDone was wrong. It should use something like strlen(address) not INET_ADDRSTRLEN

proxyVersion property never used

I checked 'proxyVersion' property of class GCDAsyncProxySocket and it never used.

In all cases you use SOCKS5

uint8_t version = 5; // VER
byteBuffer[0] = version;

What is the reason of this?

UDP Association

Does this handle UDP association? I've used past libraries without UDP association which created some hassle.

Carthage support?

Need support Carthage for macOS to reduce fragmentation and mixed use cocoapods/git-submodule/…

// - (BOOL)onSocketWillConnect:(AsyncSocket *)sender
func onSocketWillConnect(_ sender: AsyncSocket) -> Bool {
    if useSystemSocks {
        conn.useSystemSocksProxy()
    }
    else if useSocks {
        conn.useSocksProxyVersion(
            socksVersion,
            host: proxyHost,
            port: proxyPort,
            user: proxyUser,
            password: proxyPassword
        )
    }

    //if useSSL {
    //    conn.useSSL() // startTLS
    //}
    return true
}

Library crashes when 'socket:didConnectToHost:port:' delegate works

My code:

_socket = [[GCDAsyncProxySocket alloc] init];
_socket.delegate = self;
[_socket setProxyHost:@"1.243.224.225" port:8080 version:GCDAsyncSocketSOCKSVersion5];
NSError *error;
BOOL success = [_socket connectToHost:@"chat.quickblox.com" onPort:5222 error:&error];
if(!success){
    NSLog(@"error %@", error);
}

I got a crash in library http://qblx.co/RuH4de

By some reason self.delegateQueue is nil here

I fixed this by setting it manually

_socket = [[GCDAsyncProxySocket alloc] init];
_socket.delegate = self;
_socket.delegateQueue = dispatch_queue_create("my delegate queue", 0);

but this is not a good solution

it is not work normal?

When I set the proxyAutoConfigurationJavaScript value of NEProxySettings of ios to "SOCKS 192.168.31.4:8889"; start the ProxyKit Server on the mac, the phone cannot connect to the network normally, can you help me to find out where the problem is?

Need more info how to use this library

Hey there,

I'm trying to use this library in my application. I have Chat applications which uses XMPP QuickBlox Chat http://quickblox.com/developers/Chat#Server

Host: chat.quickblox.com
Port: 5222

Direct connections works perfect.

Now I need to use this Chat through SOCKS proxy. I found some free proxies here http://sockslist.net/

Here is my code

GCDAsyncProxySocket *socket = [[GCDAsyncProxySocket alloc] init];
socket.delegate = self;
[socket setProxyHost:@"1.243.224.225" port: 8080 version:GCDAsyncSocketSOCKSVersion4];
NSError *error;
BOOL success = [socket connectToHost:@"chat.quickblox.com" onPort:5222 error:&error];
if(!success){
NSLog(@"error %@", error);
}

....

  • (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port{
    NSLog(@"connected");

}

I run my app and nothing happened, I don't see anything in log. I use DEBUG mode

What could be an issue here?

Demo application

Hey,

would be great to have some Xcode demo application project to test this library.
Could you create a Xcode project with some server and SOCKS proxy

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.