class BBS::Gateway

A door to another telnet board, the telnet gateway of the old BBSes: the caller’s line is handed on to host:port as it is, and comes back when that board hangs up. The board on the other end runs its own code; this one only carries the bytes.

door :feedia, BBS::Gateway.new(host: 'feedia.example', port: 2323, name: 'Feedia'), label: '&Feedia'

Towards the other board the gateway is the telnet client: it answers its negotiation, reports the caller’s window size, and passes the caller’s later size changes on. A PETSCII line has no window size to report, so the other board takes it for a Commodore. Everything else goes through untouched both ways, mouse reports and PETSCII included.

A gateway is made for one address; a directory that dials many boards makes one a call, and reads how it went from the Report its block gets:

BBS::Gateway.new(host: 'bbs.example.org', port: 23).call(session) do |report|
  log(report.connected ? "#{report.received} bytes" : report.error.class)
end

The host is resolved once and the call goes to that address, which by default must be on the public internet (BBS::Address.public?): a listing cannot make the board a relay into its own network. A board that dials its neighbours (host.docker.internal, a container) says public_only: false.