You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspired by [Corey Quinn](https://github.com/QuinnyPig) Tailscale [layer](https://github.com/QuinnyPig/tailscale-layer) project. This project aims to do the same thing but usable for those working with any Lambda Container runtime language.
5
-
6
-
This Tailscale extension has been modified from Corey's upstream work. We have removed verbose logging and event lifecycle hooks which just did some verbose logging.
4
+
Inspired by Corey Quinn's [tailscale-layer](https://github.com/QuinnyPig/tailscale-layer) project. This project aims to do the same thing but usable for those working with any Lambda Container runtime language. Our extension has been modified from Corey's upstream work. I have removed verbose logging and event lifecycle hooks. This has reduced startup overhead, duplicate tailscale up calls, and more configuration options.
7
5
8
6
## Installation
9
7
@@ -31,7 +29,7 @@ We publish multi-platform images for both `linux/amd64` and `linux/arm64/v8` and
31
29
- ghcr.io/rails-lambda/tailscale-extension-amzn
32
30
- ghcr.io/rails-lambda/tailscale-extension-debian
33
31
34
-
## Usage
32
+
## Example Usage
35
33
36
34
Once your Lambda function starts, you will have a [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) proxy which can communicate with your Tailscale tailnet at `http://localhost:1055`. Here is an example of how to leverage that with Ruby's [socksify](https://github.com/astro/socksify-ruby) gem.
37
35
@@ -41,85 +39,4 @@ Net::HTTP.socks_proxy('localhost', 1055).start(...) do |http|
41
39
end
42
40
```
43
41
44
-
Again, this extension is not coupled to any runtime language. So how you use the SOCKS5 proxy is up to you.
45
-
46
-
## Why? An Example!
47
-
48
-
I am currently using this extension to help develop our new LambdaCable gem which uses API Gateway's WebSockets. We reached the point where a faster feedback was required. So I use this proxy to forward all Lambda events to my local development.
49
-
50
-
In the example image below, the Tailscale Extension is used on the "Lambda Proxy" to send all HTTP and WebSocket event traffic to my local machine, illustrated below.
When running local development services to be used via a proxy, it is important that you use the `0.0.0.0` address to bind to all local interfaces vs the default of `127.0.0.1`. Doing so will ensure that [Tailscale Services](https://tailscale.com/kb/1100/services/) are updated and available. For Rails development server, use something like this:
98
-
99
-
```shell
100
-
rails s -b 0.0.0.0
101
-
```
102
-
103
-
[Dev Containers](https://containers.dev/) are an amazing technology spec used by great products such as [Codespaces](https://github.com/features/codespaces) and [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). If you are using them, you will need to ensure your Dev Container is forwarding the right ports. If your Dev Container is a single image (vs compose), then you can do this in the `devcotainer.json` file:
104
-
105
-
```json
106
-
{
107
-
"forwardPorts": [3000],
108
-
}
109
-
```
110
-
111
-
However, our Rails Lambda Dev Container leverages a `dockerComposeFile`, so you would also have to open that compose file and add this to your `devcontainer.json` matching `service` within the compose file. For example:
112
-
113
-
```yaml
114
-
services:
115
-
app:
116
-
ports:
117
-
- 3000:3000
118
-
```
119
-
120
-
Here are a few helpful GitHub Issues I found on this topic.
121
-
122
-
- [Add support for devices in devcontainer-feature.json #153](https://github.com/devcontainers/spec/issues/153)
123
-
- [Port forwarding issue in Containers #1009](https://github.com/microsoft/vscode-remote-release/issues/1009)
124
-
- [Tailscale not detecting Docker Port Forwarding to Host #5813](https://github.com/tailscale/tailscale/issues/5813)
125
-
42
+
Again, this extension is not coupled to any runtime language. So how you use the SOCKS5 proxy is up to you. Enjoy!
0 commit comments