Code Monkey home page Code Monkey logo

Comments (5)

plkgq avatar plkgq commented on July 17, 2024

WX20210622-173350@2x

from openvpnadapter.

ss-abramchuk avatar ss-abramchuk commented on July 17, 2024

Hi @plkgq,

Looking at the exception it seems to me that you are trying to store NEPacketTunnelFlow object into some special storage like UserDefaults or tunnel settings. And as the exception message said it is not possible because this object doesn't adopt NSSecureCoding protocol.

As for cocoapods, thanx for suggestion, although I think it would be better to define additional subspec so at the end we would have one for extension, and one for client app. I'll fix it when I have enough spare time.

from openvpnadapter.

plkgq avatar plkgq commented on July 17, 2024

Thank you very much for your reply
I double-checked my code and found no special storage
WX20210624-164824@2x
I just executed [self.vpnAdapter connectUsingPacketFlow:self.packetFlow];
WX20210624-175848@2x
WX20210624-175901@2x

from openvpnadapter.

ss-abramchuk avatar ss-abramchuk commented on July 17, 2024

Ahhh... I see what's wrong. In 0.7.0 version delegate's API has changed, in openVPNAdapter(_:configureTunnelWithNetworkSettings:completionHandler:) you use packetFlow as completion handler argument. But now completion handler accepts NSError that returned by setTunnelNetworkSettings. Here how it could be done in Swift:

func openVPNAdapter(
    _ openVPNAdapter: OpenVPNAdapter, 
    configureTunnelWithNetworkSettings networkSettings: NEPacketTunnelNetworkSettings?, 
    completionHandler: @escaping (Error?) -> Void
) {
    networkSettings?.dnsSettings?.matchDomains = [""]
    setTunnelNetworkSettings(networkSettings, completionHandler: completionHandler)
}

from openvpnadapter.

plkgq avatar plkgq commented on July 17, 2024

Thank you again for your reply. I seem to know how to fix it.
WX20210625-155817@2x

Before that, I returned the wrong object. When I changed it to this, it worked,

but there was another problem. I found that I disconnected the network and reconnected. Later, it does not work, but I see in the log that the connection has been established, but the network is unavailable. It seems that some configuration has not been updated. I want to know how to fix it.

thank :)

from openvpnadapter.

Related Issues (20)

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.