I want to have a the client of a Meteor app establish a permanent connection to the server of a distinct meteor app. socket.io seems to be the way to go for this type of connection.
Thanks to this I can use socket.io with meteor and initiate the connection from the client of the first app, apparently like this:
var socket = io('http://app2.com');
socket.emit('ping', 'dummy');
How can I create a route to respond to this request from app2 server?
To make things a bit clearer:
----------------
| client of app1 |
----------------
\
want socket.io to run here
\
---------------- ----------------
| server of app1 | | server of app2 |
---------------- ----------------
Happy to answer any question you may have!
Related
We have several servers in our infra for which we are unable to trace the Openstack Project Details.
Is there any way to fetch the associated project ID/ Name details from the VM?
On my cloud:
$ openstack server show ab852bda-978e-4fd0-ba60-f4eebab327d3 -c project_id
+------------+----------------------------------+
| Field | Value |
+------------+----------------------------------+
| project_id | dfe697576058427d96d59bf45433636d |
+------------+----------------------------------+
In VM,
ip a
So, learn ip of VM
(actually, you should be knowing IP, if you are able to connect it..)
Then, in openstack cli, filter according to ip addresses.. This way, you can learn which project it belongs to...
We need to identify all network traffic that a specific Android/iOS app induces. The app is using Firestore in the backend. By default, connections to Firestore always use the domain firestore.googleapis.com instead of a project-specific subdomain (like Cloud Functions do, for example). This way those connections can't be related to a specific app by only examining the outgoing or incoming network traffic of the device.
Is it possible to route the traffic through a proxy or similar to be able to identify connections uniquely?
+-----+ +---------------+ +----------------------------+
| App | ----> | Reverse Proxy | ----> | Firestore |
| | <---- | (mydomain.com)| <---- | (firestore.googleapis.com) |
+-----+ ^ +---------------+ +----------------------------+
|
|
Connections that must be
uniquely identifiable
for a specific app
Is this possible with Firestore (at least, there's a function setHost() in the client SDK) and if so, what drawbacks would it have?
You can try to create a reverse proxy server and install on it the Firebase Emulator. You can then connect to this server from your app. The emulator will receive your requests and redirect them to Firestore. This will give you some flexibility and achieve your use case to some extent. read more about the Firebase Emulator here
In our project, we want to use HAproxy as a Load balancer which is done on a VM, and Nginx is used as a server. Is it possible to do? or is it necessary that we use one Nginx for the load balancer and another one as a server?
Yes, HAProxy only need an address:port
So you can forward to an NGinx that will expose your app
Or forward directly to applications port
Both will work.
HAProxy
| |
| |
NGinx NGinx
| |
| |
App App
HAProxy
| |
| |
App App
im building an app to track changes of contacts in Hubspot via a Webhook.
I deployed the service on Cloud Run (GCP) using the following services:
A single Docker container listening to port 8080
Nginx + UWSGI for production purposes
Flask as a framework to update some external data
The problem i got is that everything is built correctly, but when theres more than one request received to the container (for example 100 contact deletions) only a few of them are being processed.
I though that nginx handled the requests and sent it one per one to my Flask app.
If this is not the case. How can i handle this situation?
Thanks in advance :)
You can use gunicorn to handle more requests, gunicorn runs your flask app with more than one workers.
Just add gunicorn in your requirements.txt then put the CMD line to Dockerfile:
CMD ["gunicorn","-t 30", "-w3", "-b 0.0.0.0:8080", "app:app"]
-t max timeout (in seconds)
-w workers (recommended to keep same with processor cores you have in server)
-b binding adress
app:app means run app in app.py so you should edit this according to your flask app.
I am planning to ship a "home server" type device to customers, that communicates with their (Android or iPhone) smart phone. The problem is that, depending on their internet service provider, the customer has no outside-reachable IPv4 address (DS-lite tunneling), so the smart phone can't just use an IPv4 DNS record to find the server.
Alternatives I can think of:
Make the server use an IPv6 DynDNS service, and make IPv6 take preference over IPv4 on the smart phone. Since the solution should work without the customer having to sign up for a DynDNS service, I have not found any service that allows me to do that.
Set up my own "directory server", such that the home server registers it's serial number in intervals - so similar like DynDNS, but on the application layer via HTTPS. A client could then simply enter the serial number into the app to find the server. Due to authentication/encryption requirements, this solution is harder to implement than I like.
Any other ideas on how to make a home server reachable? I would really like to avoid running my own "cloud service". Some type of peer to peer network discovery, perhaps?
[UPDATE:] This is what I am essentially looking for:
Home server Relay DynDNS Client
| | | |
|-------- open tunnel to port 80 ----->| | |
|<-success, listening on 192.0.2.1:80 -| | |
| | | |
|----- Register "my.ddns.net" ---------------------->| |
|<------------ "my.ddns.net" is now 192.0.2.1 -------| |
| | | |
| |<- GET http://my.ddns.net -|
|<------- GET http://my.ddns.net ----| | |
|--- HTTP response ------------------->| | |
| |----- HTTP response ------>|
Making connection from the internet to a server in a home is difficult. IPv6 is not available everywhere yet and with IPv4 you don't always have a public address available (with multiple NAT layers or DS-Lite).
The only reliable solution today is to have a publicly reachable server as rendezvous point and let the home box maintain a permanent collection to that server. Mobile devices (which might be behind NAT as well) can then reach the home box through the server or set up STUN/TURN style connectivity.
Thanks to the other responses, I had the starting points to find some existing solutions: ngrok and localtunnel solve the problem by mapping a dedicated subdomain to each Home Server, and dispatching requests based on HTTP(S) GET requests.
The latter is an open source project, and the server, as well as a javascript client are on Github.