React Native Expo access VPN endpoint - react-native

I´m developing an project using react native Expo that needs to fetch an JSON document, on a endpoint that is covered by an VPN connection using SSTP tunnel.
I have been developing on Android Emulator and iOS Simulator, with my computer configured on VPN connection and its been working fine with no problem at all, the app on the emulators can fetch the request url and get the json document.
When i try to use the tunnel or lan method to expose my app on real devices, the app its successfully installed but cannot fetch the url, it always says Http request throws Network Request Failed. Both are in the same network, there is any reason why this happen or any clue?

After some digging i finally found what i want. Basically all i needed to do was to expose my VPN Webservices connections by using ngrok or other program for the same purpose. The program will create a tunnel (HTTP and HTTPS) creating an hole on the firewall and a custom URL to access.
There are many ways to do the same, for me the ngrok was the best but this link help me a lot to understand: How to call a locally hosted server from Expo? and also the ngrok documentation and How to Run Ngrok to Test & Share Your Local Development

Related

Can't access NestJS API on same network

When trying to access my NestJS api running locally MacBook from a React Native app, axios gives me a LOG "Could not connect to the server.". Even when trying to access the http://192.168.65.1:3000/ from another laptop does not work. I can weirdly ping the server from another device just fine. And running it on the same MacBook with localhost also works. I have set up a fairly basic NestJS api with Fastify. I have no firewall running. What the hell am I missing?

React Native impossible to get access to a sandbox in 4G but work in Wifi

I have a weird issue, I got a sandbox wss://v2.sandbox and https://v2.sandbox links every request on the API Rest, and the socket server works fine in Wifi but when I want to try the App in 4g no a single request work. Same behavior with my browser, impossible to get access to the dashboard, API rest, or socket server with a shared connexion but work in wifi.
I checked the banip list - clear
I checked my DNS - clear (using the DNS of Google)
My partner who made the BO think that could be the app but I test several free APIs, socket servers anything works still no access to his BO.
I would appreciate some idea on this issue that is out of my spec.
I'm using a Fresh install of RN
I test both fetch API and Axios same results.
RN Version: RN 63.4
Issue solved it was DNS Propagation issue with ip

How do I resolve my expo client app on Android that stop working?

How do I fix this?enter image description here
You should switch to using the tunnel connection type, it seems like you are unable to connect to other devices on your network.
This is discussed in the "Create a new app" section of the documentation: https://docs.expo.io/versions/latest/get-started/create-a-new-app/#opening-the-app-on-your-phonetablet
Is the app not loading on your device?
First, make sure that you are on the same wifi network on your computer and your device.
If it still doesn't work, it may be due to the router configuration — this is common for public networks. You can work around this by choosing the "Tunnel" connection type in Expo Dev Tools, then scanning the QR code again.
🐢 Using the "Tunnel" connection type will make app reloads
considerably slower than on "LAN" or "Local", so it's best to avoid
tunnel when possible. You may want to install a simulator/emulator to
speed up development if "Tunnel" is required for accessing your
machine from another device on your network.

Issues encountered on a fresh installation of RocketChat (1524) on Ubuntu

I have just downloaded and installed latest Rocket.chat using SNAP tool on Ubuntu (16.04 LTS). Overall, I had a smooth experience of installing and getting started with Rocket.chat. However, I did find a few serious issues.
I try to get auto SSL running by following the instructions at: https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/autossl/. But after configuring the Caddy file, the Caddy service failed to start, with the message:
Activating privacy features… 2018/04/24 17:58:09 open /root/snap/rocketchat-server/1254/.caddy/acme/acme-v02.api.letsencrypt.org/sites//.crt: no such file or directory
The second issue is with start video chat using webRTC. When I clicked on it, nothing happened. I am using Chrome browser and tried to start video chat on several devices. All the Chrome browsers have passed the webRTC tests. I don’t know why video screen is not shown.
I signed in with open.rocket.chat and compared the differences between my installation and the official site. When my browser points to open.rocket.chat site, the videochat does not work either. It does show the video window, but only displays only myself, not the remote member. Note to experiment, I signed up with 2 accounts to simulate 2 members chatting.
Also I downloaded the Android Rocketchat client. However, I couldn’t find the start video chat option. Is it true that video chat is unavailable yet on the Android client?
To summarise, we have the issue of setting up auto SSL with Caddy, and using video chat (webRTC). It could be that I missed a few basic configurations on my environment. Other functions like text messaging works fine.
We are deciding whether we should use Slack/CometChat for our instant messaging solution. It seems RocketChat has all the features we want, but it is a pity we couldn’t get it to work completely.
Appreciate someone can guide me in this.
I did some investigations on these issues, and have made some progress. I'd like to share my findings, which I hope could be of some help in future to newbies of RocketChat like me.
However, I still have a few issues unresolved, and hope someone could help.
Caddy service failed to start
Using self-signed certificate and defining the domain name in /etc/hosts, I can get Caddy service to start and https to work. My guess is that the domain name I used, even it is registered with a DNS provider, has no CNAME record, and is not mapped to any IP address. Letsencrypt, which is used by Caddy to do on-demand SSL, therefore is unable to create a SSL certificate for my domain name. It would be nice if the RocketChat documentation could make it clearer.
open.rocket.chat WebRTC-based video chat not working
after I used another Windows machine, the video chat is working. Presumably my previous computer does not have the latest Windows update. But I am glad with open.rocket.chat site, every feature I tested is working.
On my self-hosted Rocket-chat (i.e. a Linux server at home), however, the video chat is still not working. When I clicked on the "start video chat" button, no video screen is launched on my browser window. On the remote browser (which was used for simulating the conversation partner), there is a notification "xxx invites you to video chat, do you accept?". I clicked on "Yes". After that, nothing happens on the remote browser. The only issue I can think of is that I didn't use https to connect to the self-hosted Rocket-chat. Because I am using several computers in my home wireless network. I only use http://192.168.0.3:3000 to point to the chat server. I am wondering if secure connection is required in order to use video chat?
On the Android Rocket Chat app, I couldn't find any links to start a video chat, nor can I receive any video chat invite. Is it by design or a defect?
Hope someone can enlighten me on these issues.
I made further investigation as to why webRTC does not work on my self-hosted Rocket-chat instance. It is related to secured connection. There is a related discussion in the RocketChat forum:
https://github.com/RocketChat/Rocket.Chat/issues/1813
Basically, the connection to the Rocket.chat server must be secure for WebRtc to work. After I configure Caddy to support HTTPS listening on Rocket.Chat (currently using self-signed certificate), WebRTC works. It would really help users if the documentation can make this clear.
Now the remaining issue for me is to figure out if Android Rocket Chat app supports Web RTC.

Browser based document scanning

I am building a browser based application for document scanning. I have looked at offerings from multiple providers like dynamosoft, asprise, atalasoft etc. My basic question on browser based document scanning is that does any of these products enable scanning from remote machines, using browser based interface? Or should scanner be always connected to the system from where browser is launched?
Yes. Browser based document scanning relies on the communication between a local service and the web client. Usually, you need to download the installer of the local service when browsing an online demo of document scanning at the first time. If you want to scan documents from a remote machine, just deploy the service on that machine. Then change the IP for web socket connection.
For example, here is the architecture of Dynamic Web TWAIN.
The scanner should be always connected to the system from where the local service (not the web browser) is launched.
You can watch the video to see how to use Raspberry Pi as the scanner service to capture documents from iMac.
Yes, There is a Application that enable scanning on remote machine. When someone open the browser a connection between web browser and that local machine application established. This connection is done easily by HTML5 Web Socket. Local application do scan and send this image via this connection to your Browser.
Here is the open source repository,
ScanAppForWeb
I'm hoping this will be helpful, though it's not a direct answer to the question.
After spending a lot of time trying to get WebUSB to work try researching other options, I found a solution that works well for my web app. Simply use scanimage to scan to the server. The client sends and AJAX request, the server builds a command string to run with shell_exec in PHP, then use file_get_contents or whatever with the scanned image. In my situation, there's no reason for the scanner to talk to the client, since the image is going to end up in a database on the server anyway.
See also: https://stackoverflow.com/a/63198443/4509516
Extrieve HTTPTWAIN browser-based document scanning SDK support , document scanning from a remote PC. This require service client to be deployed on the remote PC and Web module should connect to the service using ip and port of the remote pc.
To Know more visit- https://www.extrieve.com/web-document-scanning/