h2o/h2o — pull request #51 by cubicdaiya (2014-11-09 23:12:47+00:00)
Title: add support for reverse proxing to unix socket

I added support for reverse proxing to unix socket. `h2o`'s reverse proxing to unix socket is twice faster than its reverse proxing to tcp-port.

```bash
$ ab -k -n 10000 -c 500 "http://127.0.0.1:8081/tcp" 2>&1 | grep "Requests per second:"
Requests per second: 8923.78 [#/sec] (mean)
$ ab -k -n 10000 -c 500 "http://127.0.0.1:8081/unix" 2>&1 | grep "Requests per second:"
Requests per second: 16566.69 [#/sec] (mean)
$
```

The followings are configurations for this benchmark.

## h2o.conf

```yaml
listen:
port: 8081
hosts:
default:
paths:
/tcp:
proxy.reverse.url: http://127.0.0.1/
/unix:
proxy.reverse.path: unix:/tmp/nginx.sock:/
```

## nginx.conf

```nginx
worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

server {
listen 80;
root html;
}

server {
listen unix:/tmp/nginx.sock;
root html;
}

}
```