Lack of SOCKS or HTTP proxy support
I've been experimenting with using Tailscale to securely access a Redis instance in another AWS VPC from an AWS Lambda without exposing it to the public internet.
In theory, we need two pieces for this work
- A public AWS EC2 instance which runs the Tailscale tunnel to securely expose the private subnet where the Redis cluster is.
- An AWS Lambda function running Tailscale in userspace networking mode since regular VPN connections through
/dev/net/tunare not possible. Instead, Tailscale creates a SOCKS5 (or HTTP) proxy onlocalhost:1055.
I've been able to make all of this work and the Redis instance is accessible from my desktop running the Tailscale client. However, when trying the same in the AWS Lambda, I was not able to make Redis aware of the proxy.
Some other tools like MongoDB and PostgreSQL do support this sort of configuration.
Environment:
- Node.js Version: 14
- Redis Server Version: 6.2
- Node Redis Version: @redis/client 1.1.0
- Platform: Ubuntu 20.04.3
Actually, I've dug into the code a bit more and it seems like createClient accepts a socket option which could be created by something like https://github.com/JoshGlazebrook/socks. However, this library opens the socket and performs the SOCKS handshake before createClient receives it which causes issues when createClient tries to call connect on the socket again 😞
@emeraldsanto would it work on using command: 'bind' instead? (https://github.com/JoshGlazebrook/socks#bind-example-tcp-relay)