Setting up FRP on fly.io

So, I needed a reverse tunnel. frp looked nice. OwO Someone already made a fly.toml template! I’ll use tha-

TCP or UDP tunnel, not both Since in fly.io, it is required to bind to fly-global-services in order for UDP to work, but frp proxy_bind_addr only allow to bind in one address, so we need to disable TCP if you want to use UDP as TCP does not work on fly-global-services.

You need to have a separate frp instance if you need to tunnel both TCP and UDP. One for TCP using proxy_bind_addr = 0.0.0.0 and one for UDP using proxy_bind_addr = fly-global-services.

No. I don’t think so.

fly deploy.

now i’m stuck fiddling with the fly.io build agent here. i still can’t tell what’s wrong. but now it works. seemingly. 50% of the time is spent on fiddling with the build agent. On build failure, the error logs won’t show up until I push a new version awawaawawawawawawawawawa

cd ../frp/
CGO_ENABLED=0 go build ./cmd/frps
cd ../flyfrp/
cp ../frp/frps .

fly deploy.

UDP works. TCP… need to be defined in fly.toml?

TCP port number is integer. It’s finite. We can do this.

cat all-the-ports.py 
for port in range(1, 65536):
  if port == 80: continue
  print(
f"""[[services]]
  protocol = 'tcp'
  internal_port = {port}

  [[services.ports]]
    port = {port}
"""
)
❯ python all-the-ports.py >> fly.toml

fly deploy.

✓ Configuration is valid

:)

✖ [1/2] Machine 7843ed4a253e78 [app] update failed: failed to update VM 7843ed4a253e78: http: request body too large

:(

i hate containerization.

but how big is it?

❯ wc fly.toml
 458809  721023 6270294 fly.toml

:>


tried

EXPOSE 1025-1030/tcp

and

EXPOSE 1025-1030

both didn’t work.

finale

at least it works now

UDP: all ports are supported.
TCP: ports need to be added to both Dockerfile and fly.toml. connections are only established 50% of the time.

I need better infra…