Hi all, I deployed a nats server instance using the official nats image and trying to connect to it from another app which is just a bun server using the @nats-io/transport-node npm library.
Here’s my config for the nats server:
# fly.toml app configuration file generated for coindozer-nats on 2024-11-07T17:45:59+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'my-nats'
primary_region = 'sin'
[build]
image = 'nats'
[[services]]
protocol = 'tcp'
internal_port = 4222
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
port = 4222
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
However, the bun server keeps running into timeout errors emitted by the nats client library while trying to connect to the nats server. I’m properly using my-nats.flycast:4222 as the connection string when using the library. Should also note that the bun server is able to properly resolve the my-nats.flycast address through DNS after inspecting using Bun.dns.resolve. Is it not possible to use nats behind a flycast proxy? can I only use private 6pn addresses? thank you.