React Native VPN

Gentlemen, has anyone managed to implement access to a VPN network using React Native? I’m developing an App that needs VPN to work, but I didn’t want the user to need to install another VPN client on their cell phone. Does anyone know any lib or workaround for this scenario? Thanks in advance.

What traffic do you intend to send over the VPN?

My application is a system that makes REST requests for an API that only accepts connections via VPN. Currently I have to have the OpenVPN application installed on my cell phone to be able to send and receive data. Many thanks for the reply.

VPNs are not all the same. If this API requires the requests to be done via OpenVPN, then you have no choice but to install OpenVPN.
If they don’t specifically require OpenVPN, how does it work?
But either way, Expo does not have any VPN functionality built in.
What you could possibly do instead of having OpenVPN on each phone is to install it on a server with a proxy server. The app could make requests via the proxy, which would relay the requests over the VPN to the API.
Whether the owners of the API would be OK with that solution, is another story…

2 Likes

I will talk to the network analyst to implement this solution and test it. I’ll get back to you as soon as possible. Thank you very much for the suggestion.

not bad, this topic is very interesting

Nice post, thank you

As a Freelance Project i also got a project to make a Vpn service using react native and expo and with its backend in Node js any suggestions how to implemented
I would really appreciate it

As a Freelance Project i also got a project to make a Vpn service using react native and expo and with its backend in Node js any suggestions how to implemented
I would really appreciate it

Hi @abdullah.mumtaz65

It’s hard to say without knowing the requirements. “A VPN” is too vague.

The easiest way to do something VPN-like is to set up a proxy server and update the proxy settings on the devices to talk to this proxy server.

I don’t know what’s needed on iOS or Android to implement the low-level networking stuff to allow traffic from all apps to be routed over a “proper” VPN. I suspect you’ll need to write most of that part in native code. Maybe you can have this native code in a React Native app, but I’m not the best person to ask about that.

About the server side: You might find it’s better to use a proper VPN server like OpenVPN or WireGuard etc. instead of a web server, but it depends on your requirements. Maybe a web server written in nodejs is OK for your use case.

Anyway, you might try searching for “VPN React Native” and see what you can find.