This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #user nginx; | |
| # TODO(0): Changer welcome to nginx par Welcome to your app et si l'app n'exsite pas faire une erreur 500 | |
| user root root; | |
| error_log /var/log/nginx.error.log; | |
| pid /var/run/nginx.pid; | |
| #Config changes found here: http://stackoverflow.com/questions/7325211/tuning-nginx-worker-process-to-obtain-100k-hits-per-min | |
| worker_processes 4; # 2*number of cpus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # nginx | |
| description "nginx http daemon" | |
| author "George Shammas <[email protected]>" | |
| start on (filesystem and net-device-up IFACE=lo) | |
| stop on runlevel [!2345] | |
| env DAEMON=/usr/sbin/nginx | |
| env PID=/var/run/nginx.pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Connection | |
| constructor: (@socket, @manager) -> | |
| @socket.setEncoding 'utf-8' | |
| @socket.on 'data', incomingData | |
| @socket.on 'end', connectionClosed | |
| @peerMet = false | |
| incomingData = (chunck) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tls = require 'tls' | |
| fs = require 'fs' | |
| Connection = require('./connection').Connection | |
| class Rendezvous | |
| @unPairedConnections = [] | |
| connectionFindOutSecret: (connection, cb) => | |
| #check if a connection with the same secret exists in the unPairedConnections list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| express = require 'express' | |
| fs = require 'fs' | |
| app = express() | |
| authenticationFilter = (req, res, next) -> | |
| auth_token = req.query.auth_token | |
| if auth_token == process.env.AUTH_TOKE | |
| next() | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "os" | |
| "io/ioutil" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -e | |
| sudo apt-get update | |
| sudo apt-get install -y curl build-essential bison openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf ssl-cert libcurl4-openssl-dev nginx | |
| echo "Installing Ruby..." | |
| echo " -> Downloading Ruby" | |
| wget -q http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz | |
| echo " -> Extracting tarball" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -e | |
| sudo apt-get install -y curl build-essential bison libreadline6 libreadline6-dev zlib1g zlib1g-dev libyaml-dev libxml2-dev libxslt-dev autoconf | |
| #installing ruby | |
| wget -q http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz | |
| tar xf ruby-1.9.3-p0.tar.gz | |
| cd ruby-1.9.3-p0 | |
| ./configure --disable-install-doc | |
| make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -e | |
| sudo apt-get update | |
| sudo apt-get install -y curl build-essential bison openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf ssl-cert libcurl4-openssl-dev nginx | |
| echo "Installing Ruby..." | |
| echo " -> Downloading Ruby" | |
| wget -q http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz | |
| echo " -> Extracting tarball" |
NewerOlder