Skip to main content

Posts

Showing posts from January, 2015

Dockerize a node.js WebSocket server in 5 minutes

Docker is an incredibly useful tool to build prototypes of Linux hosts and applications. You can easily build a network of servers inside a single virtual machine, with each server represented by a docker container. Clients can access the services on the same IP address, but different ports. In this post I'd like to talk about a common prototype case in WebRTC  platforms: a WebSocket server. This will be a node.js server and will run inside a Docker container (hosted by an Ubuntu Trusty VM). The server logic can be as complex as you can imagine, but since it's not the point of this post I'll keep it as simple as the server example in the node.js websocket module : The WebSocket server will listen on port 8080, accept incoming connections, send back "something" upon client connection, and log the content of the messages from the clients. We can assume all the files in this article are in the same folder, and we're cd into it. The server logic is...

Easy VPN setup accross multiple sites

I recently had a scenario where I needed to connect servers belonging to: - Digitalocean , on data center X - Digitalocean, on data center Y - A private data center and each architecture needed to be replicated on a number of "logical" environments (e.g. 'development', 'testing', 'production'). They needed to "see" each other, in a secure way. Note that virtual machines on Digitalocean (they call them 'droplets') can belong to different data centers. When the droplets use the optional private interface there are two things to consider: 1. Traffic inside the same data center is potentially visible to any equipment on the same data center. In other words, the fact that two droplets belong to the same customer account doesn't mean that their private traffic is isolated from any other traffic belonging to droplets on other accounts. You are responsible to secure that traffic. 2. Droplets on different data centers cannot ...