talmobi/tor-request

one more thing... tor unix socket instead of TCP?

Closed this issue · 4 comments

TorControlPort: {
    password: "", // default ControlPort password
    host: "127.0.0.1", // default address
    port: 9051, // default ControlPort
 }  

Does Tor allow Unix Socket connections to be made instead of TCP. Read somewhere that sockets are something like 60% faster...

I don't know, possibly. However, I don't think that will be a significant bottleneck. The vast majority of latency will be due to network latency.

Kind of figured the same...here is something I just changed in Express App, been wanting to do this for a while and I finally found the stackoverflow post...

NodeJS -> Unix socket -> NGINX

https://serverfault.com/questions/316157/how-do-i-configure-nginx-proxy-pass-node-js-http-server-via-unix-socket

Here is what I did just now, only run Unix Socket on production only...

  if(process.env.NODE_ENV) {
    server.listen('/tmp/app.socket')
    server.on('listening', ret => {
      fs.chmodSync('/tmp/app.socket', '777')
    })
    return loadSockets()
  }
  server.listen(app.nconf.get('app:port'), '0.0.0.0', ret => {
    loadSockets()
  })

NGINX Config File

server {
  listen 80;

  location / {
    proxy_pass server unix:/tmp/app.socket;
  }
}

Hmm, never tried that with NGINX.

I don't have any intelligent response without playing with it myself yet. Looks interesting though.

Alas I still don't think it will really improve performance unless you're hitting up to half of max theoretical LAN speeds. (Which is generally unlikely over the internet, especially through tor)

I am just a crazy optimization freak. I am reducing app memory usage and making tweaks everyday. I'd probably be filthy rich right now if I didn't spend so much time on these minor details. lol

https://stackoverflow.com/questions/1099672/when-is-it-appropriate-to-use-udp-instead-of-tcp