Post

Replies

Boosts

Views

Activity

Reply to Building a custom VPN application from scratch
Per your suggestion, can you provide working minimal examples on these PacketTunnel with example code on packet processing App Proxy Provider with example code on packet processing Transparent Proxy Provider with example code on packet processing I'm doing this for MacOS only, no need for iOS projects. I don't see anything helpful on github.
3w
Reply to Building a custom VPN application from scratch
In xcode select File -> New -> Target Choose System Network Extension, select PacketTunnelProvider. Now I get this stub code, but don't know what to do next. I need a minimal working example. @implementation PacketTunnelProvider - (void)startTunnelWithOptions:(NSDictionary *)options completionHandler:(void (^)(NSError *))completionHandler { // maybe process the packet from there? a tcp level read / write method call? } - (void)stopTunnelWithReason:(NEProviderStopReason)reason completionHandler: (void (^)(void))completionHandler { // Add code here to start the process of stopping the tunnel. completionHandler(); } - (void)handleAppMessage:(NSData *)messageData completionHandler:(void (^)(NSData *))completionHandler { // Add code here to handle the message. } - (void)sleepWithCompletionHandler:(void (^)(void))completionHandler { // Add code here to get ready to sleep. completionHandler(); } - (void)wake { // Add code here to wake up. } @end
3w