In-house iphone app database connection - iphone

I am going to build an in-house application within a company. I was told that the data sample is located on the DMZ network, so how can I connect to this? The main task is going to surface data and display it. I have no idea about DMZ network and is there sort of API available to achieve this?

There is not any API for direct connection to Database(as per my knowledge)
create a local web-service, which will accessible only in DMZ network.
User those web-methods to communicate with database.
As the access of web-service is within DMZ, user will have access of data within DMZ network

Related

Offline mode for SAAS multitenant Web Application

We have SAAS multitenant Web Application for hotel reservation and Key issuing, that can work both in Online and Offline modes.
The user needs limited features like making the reservation and issuing keys for Guest through the webapp, in case he is offline and full feature access when he becomes online again. I thought of the following options:
Make the hotel host a server locally that will replicate event from the cloud database to the local
Create a light version of limited feature of the App to host locally with the replicate Database
Create a shortcut URL to local computer but Only allow access to the local web app when Internet connection down
Save all message(CRUD from feature table) to a Queue in the local server(Linux box)
When internet is back, send these to the cloud for data Sync
This seems like a good solution since it is cover the scenario and it integrates a local server, relational datastore and a queuing messages to send to cloud
Very easy solution when it come to mobile , but since this is a web, we seems to be limited by available technics.
Has anyone worked/working on such an application. Ideas welcome.

Bridging/cloning Matrix Synapse server in intranet with server in internet

I would want to bridge or clone two Matrix servers, one located in a intranet and the other in internet. Intranet can access internet (with not infrequent cuts) but cannot be accessed from internet. Both server are connected by a VPN so they can communicate each other.
Many of the users connect from the intranet and other from internet. The goal is that the intranet users can connect without going to internet, because the internet connection is metered and long periods without no internet connection are frequent. Ideally both servers would act as a unique Matrix server, so intranet users don't need to create two accounts. Servers should synchronize events whenever the internet connection is working.
I suppose this is not feasible without a quite big chunk of code. My doubt is which pieces of software should I create. Should I develop a bridge? Perhaps a bot approach or account linking? Any more suitable solution I am not aware of?

how to prevent my app from sending data through proxy?

I am developing a chat back-end application on aws cloud. In order to make a scalable architecture for the chat back-end I must ensure that the one who is opening a connection is the real one.
To be more accurate that chat ofcourse must keep a tcp connection open with the server all the time and I have the following problems:
1 - the back-end has a load balancer elastic load balancer.
2 - the tcp connection between the client app and the back-end server must stay open and alive. which mean the app must keep the connection alive with the server not the elb load balancer.
3 - the elb load balancer must send the connection and load through a session table sticky session to the same server the app connected to before.
unfortunately, the load balancer only support l4 and l7 layers and I think I need to use the l3 layer.
the main problem here is most people operate behind proxy server so I can't maintain a connection with them because the tcp connection will be made with the proxy and not their app.
I don't know how to solve this but the only solution that I know now is:
I must prevent the users from operating behind any proxy servers to make sure the tcp connection is direct with them not the proxy, how do I do that?
If there is a way to let them operate behind a proxy and a solution can be made on the back-end tell me.
I'm not sure I understand your concern. If you are using web sockets, most proxies would allow this type of communication but they can cause you troubles as well if they have timeouts and such.
You cannot control whether someone is behind a proxy. In many cases the proxy will be completely transparent so you'd have no way to know it is there without inspecting all of the network hops. You may want to read up further on this. A good start is this article -
https://www.infoq.com/articles/Web-Sockets-Proxy-Servers
If you are attempting to use the IP address as an authentication mechanism, I suggest instead using a standard authentication mechanism. Once authenticated, you should manage the session using either session cookies, JWT, or another standard session management solution. Note that JWT is typically stateless (doesn't use a session) but can be used to authorize a user to session type data.

Is there any way to use same IP for several requests with GAE Sockets API?

I'm using third party service that has own notion of session and expects all requests in session to come from same IP. They claim that it's a required security measure and suggest to use proxy, LOL.
Is there any way to use same IP for several requests with Socket API?
Interval between requests in session is ~10 seconds, so keeping connection alive and reusing it should work. I've tried to setup proxy module that runs single instance and uses HttpClient with connection pool. Logging shows that after first request connection is properly released and stored in pool. While doing second request I see that pool has 1 connection, but HttpClient says that there in no free connection for route and opens new. Probably route changes somehow?
It goes against the way App Engine is meant to work, scale-ability. Spawning instances closets to the consumers and multiple instance will mean different IP's. If you want a static IP you will need to switch to Compute Engine. Its a server VM that can have a static IP address. Or if your 3rd party service can take range you get get them from the link.
App Engine does not currently provide a way to map static IP addresses to an application. In order to optimize the network path between an end user and an App Engine application, end users on different ISPs or geographic locations might use different IP addresses to access the same App Engine application. DNS might return different IP addresses to access App Engine over time or from different network locations.
Actually, I solved this issue. Solution that I described in question was missing one step. As my connection was SSL authenticated, I had to use same context for all requests that I make.

iPhone Application Local or Remote Database

I am planning to write an iPhone app and I am weighing in the options to either make the database local (on the device) or host on my server and access it through web services. What are the advantages/disadvantages of these two different approaches?
advantages of a local database
alwayws avaliable (also with no networkconnection)
fast because you don't need a networkconnection
secure because the data won't fly over the net
disadvantages of a local database
remotely change values (you cant change uservalues)
no statistical overview