joyent/node — Issue #2870: Crash when using req.connection.remoteAddress (cluster)
Author: vasman
Created: 2012-03-05 15:38:07+00:00
State: open

mac os x 10.7.3
nginx proxying web requests to socket.sock

location / {
proxy_pass http://unix:/var/something/socket.sock:$uri$is_args$args;
}

node v0.6.12

```javascript
if(!cluster.isMaster) {
process.on('uncaughtException', function(e){
console.error(e);
});

http.Server(function(req, res) {
try {
console.log(req.connection.remoteAddress); //crashes here
res.writeHead(200);
res.end("hello world\n");
}
catch(e) {
console.error(e);
}
}).listen('./socket.sock');
}
```

Upon connection, dies with:

Assertion failed: (0 && "bad address family"), function GetPeerName, file ../src/tcp_wrap.cc, line 237.

Neither `uncaughtException` nor `try` catch the error :(