Tailscale.Tcp (Tailscale v0.3.3)

View Source

Functionality to create tailscale TCP sockets.

See Tailscale.Tcp.Listener and Tailscale.Tcp.Stream for listen and established sockets, respectively.

Summary

Functions

Open a TCP connection to the specified address and port.

Create a TCP listener on the specified port.

Functions

connect(dev, addr, port)

@spec connect(Tailscale.t(), Tailscale.ip_addr(), :inet.port_number()) ::
  {:ok, Tailscale.Tcp.Stream.t()} | {:error, any()}

Open a TCP connection to the specified address and port.

listen(dev, addr, port)

@spec listen(Tailscale.t(), Tailscale.ip_addr() | :ip4 | :ip6, :inet.port_number()) ::
  {:ok, Tailscale.Tcp.Listener.t()} | {:error, any()}

Create a TCP listener on the specified port.

Parameters

  • dev: the tailscale device.
  • addr: the address to listen on. You can either pass an address or :ip4/:ip6 to bind to the
        tailscale device's respective tailnet address.
  • port: the port to listen on.