Is XMPP good choice for this solution? - xmpp

I want to build communication solution for my project. Thinking about not to develop everything from scratch, but to use XMPP servers.
My project consist of many "mini-servers" (based on raspberry pi) scattered around different locations. Every mini-server should be reachable for mobile applications on its own network, this network could be isolated from internet. Every "mini-server" has to be autonomous and be able to live without internet, autethicate its own mobile client and respond to their requests. So mini-servers could be on private offline networks, could be on known static or unknown dynamic IP addresses behind firewalls.
Some mini-server users want theirs mini-servers to be reachable from the internet. So there is one more, let's call it cloud. This cloud would be responsible for routing request from mobile clients from the internet to their mini-servers.
My idea was to use XMPP server on every mini-server, my application would log in to this server on localhost and create chatroom. Every mobile client would connect to xmpp server and chat with my application request-response. When mini-server owner wants to connect to the interet to be reachable from outside, I would just reconfigure xmpp server to connect to my cloud XMPP cluster (on known public domain) and mobile app to connect to this public cloud server if not on private network. Every mini-server will have its own users, managed by other app on it. Mini-server has also log, this could be written for example to another chatroom. Mini-servers or mobile users does not want to talk to each other. It is pure mobile user to mini-server request-response realtime communication.
Can cloud-XMPP servers route request to mini-server xmpp server?
Is this possible with XMPP? Is it good use? Some better ideas?

What you describe looks like XMPP server-to-server federation, with some local Raspberry PI XMPP domains and some other XMPP servers on the internet.
So, I think yes, what you would like to achieve is doable with XMPP server.
A server like ejabberd works very well on Raspberry Pi.

Related

connecting a raspberry pi to a google home

I want to control my raspberry pi with my Google Home at college, but everything I find involves a server and opening a port which I can not do on my schools network.
Is there another way I can do this?
The Google Home has no way to directly control other devices on the same network or through other wireless protocols. Everything goes through an Internet-based service and expects to communicate with devices via a server-based proxy. How that server communicates with the device is up to the developer.
Depending on your needs and capabilities, you do have a few options.
One option, for example, is to use a tool like ngrok to create a tunnel between the device itself and a service run by ngrok on the public Internet. Calls to the public https address are sent to a service running locally on your device, and you can handle it accordingly.
Another is to have your device connect to a server and listen for command changes, and then execute those changes. If you don't want to run a server, you can even use something like Firebase - have your device listen for changes on the real-time database (which can use the HTTPS port to communicate as a client, so you don't open anything) and have something like a Firebase Cloud Function act as the webhook for your Action.
Go through this blog post: http://nilhcem.com/android-things/google-assistant-smart-home
You will have to set up a OAuth server but as #Prisoner said you can use ngrok to tunnel the device to internet, BUT I would recommend using "localtunnel" as it provides a free static url and the set-up is also easy. NO Port Forwarding is required with this method.
More info on localtunnel setup:-
How to generate fixed url with ngrok
Moreover you need to activate the OAuth server only once for account linking & than you can close it.
The simplest way I can think of is to expose your Pi to the internet (using port forwarding, ngrok, or whatever) then set up an IFTTT Google Assistant trigger to invoke a webhook which points to your exposed Pi.

Port Forwarding VPN Server

i'm planning on implementing web server hosted by Raspberry Pi at home, while also having a Dedicated Server with public IP.
The main problem is that my provider charge a lot for a static ip, so i simply dont want to pay.
And here is the question:
Is it possible to achieve what i've mentioned on given diagram (if yes, then maybe some hints?)
Will RPi be accessible through local network while connected to VPN
Thank you for any help!
1.
That is basically possible, it is called a Reverse-Proxy (See wiki for a brief description). The exact implementation depends on the web server you use.
Your dedicated Server will then accept client connections, get the content over the VPN from your Raspberry and serve it to the client like it's his.
2.
Your Pi will still be accessible from the local network while being in the VPN, since it should use a virtual adapter for the connection if its a client on its own. Otherwise, if the router acts as a gateway to the VPN it will do the routing and again your Pi will be fine.

Configuring NetGear router with PHP Front End?

I have a netgear router and a PC that functions as the server. On the server I have a website that is hosted on a WAMP solution (windows, apache, mysql, php). Linux is an option, but Windows is first prize in this specific scenario.
What I need:
If someone connects to the wireless network, the splash page that is hosted on the server must be displayed.
All users must have bandwidth limits that are configurable for each user
I must be able to interact with the router via PHP code, in order to execute certain functions when certain users logon, etc.
So, my question is, how do people normally do this? Is there a way to configure this on the router (users connect to ROUTER), or is this something that can only be accomplished with a PROXY (users connect to proxy on server, server connects to internet via router).
Is this possible? Is there software available that does this? Is a proxy what I really need?
If your router supports it, you can install DD-WRT onto the router and use NoCatSplash to capture the connected user's first HTTP request and redirect it as needed.

Using VPN in objective C once user is connected to VPN with Anyconnect,F5 BIG-IP Edge

I am exploring the possibility of communicating with server that requires VPN connection outside of corporate network using iOS enabled device. I found out that I can connect to VPN using proprietary apps of Cisco, F5, Juniper etc. Assuming that user has successfully connected to VPN using these apps, can I directly communicate(call web service) from my iOS app? I know that Safari can directly communicate with server requiring VPN connection once user establish connection using one of apps I mentioned.
Thanks,
Jignesh
I'm sure that there could be unique circumstances that cause problems, but in my experience I have found that this works just fine. I have an app that interacts with SOAP services running on servers within our corporate intranet. Once I have established a VPN connection using network-specific clients (I've used both Cisco and Juniper clients) I am able to use NSURLConnection and other iOS API's to connect to those servers.

How to set up http server on iPhone behind firewall

I want to develop an iPhone app with a simple IM feature. I am thinking about setting up an HTTP server on an iPhone. If the iPhone is using wifi and is behind a firewall, how can I make sure that other iPhone clients can connect to it?
It's not the firewall that will disturb the connection as much it is the NAT.
When you are connected through wireless router to connect the internet you are surfing via NAT. it means you dont really have an extenral IP but once you initiate connection the router will map your intenral IP to one of his externatl ports and for certain time window he will pass connections to you if he will get it to the right port.
That being said, there is no actual way of setting a server behind a NAT unless you can configure port forwarding in the router and internal static IP.
Hope i was clear enough, good luck
I do not really think that you need to get an HTPP server up and running on iPhone to make an application that can send and receive messages (IM). The idea of making one iPhone user to directly connect to one another does not seem right to me since the users will need to know IP addresses of one another to do that.
Interconnectivity between different users of the chat can be solved by making your application communicate via a dedicated TCP port. It is generally advisable to choose ports with a number higher than 1024 since those below are generally found on the list of so-called well-known ports and are used for Web (like port 80), FTP (port 21), SSH (22), DNS (53), etc., it will be the responsibility of the user to make sure the port used by your application is open on the firewall. In order to solve this problem you can actually use port 80 for communication if you find that the port you have selected is blocked. You can do this because you know that this port will not be blocked in most cases. Indeed Yahoo Messenger is reported to use this technique when the firewall blocks the port it uses for communication.
The port should be used by your application to connect to the Web-server that will actually store user credentials, perform authentication, message transmission, etc., and the server should reside on capable hardware to be able to support large number of simultaneous connections. I can suggest using either a VPS (like the one provided by Linode) or a cloud (like Amazon EC2, Google Application Engine, Rackspace).