• exec/websocketservice.js

    From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:31 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/c1bebfc1dd74a83e527b4acd
    Modified Files:
    exec/websocketservice.js
    Log Message:
    Case-insensitive search for headers in ShakeHands. Some proxieslike to mangle these unless you tell them not to.Capture the value of the X-Forwarded-For header, if present, andstash it in FWebSocketHeader['X-Forwarded-For'].
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:31 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/820b805eeefd3b59621e8aff
    Modified Files:
    exec/websocketservice.js
    Log Message:
    If BBS is using HAProxy ([BBS] Options line has HAPROXY_PROTO)then throw an error if X-Forwarded-For header was not received,or otherwise do the HAProxy thing upon connecting.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:31 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/fa3e7132c14916aede750ba9
    Modified Files:
    exec/websocketservice.js
    Log Message:
    Avoid spurious connections to the terminal server - and someother unnecessary work - if the BBS is using HAProxy but we can'tdo the thing with the stuff because we don't have the things.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:31 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/a6cb6cc4907fd4116cee1921
    Modified Files:
    exec/websocketservice.js
    Log Message:
    Added inet_pton function borrowed from the internet.Added incomplete send of haproxy protocol header. Need to sortout lookup of target (BBS) IP address.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:31 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/2225ced74c74259ba11937b8
    Modified Files:
    exec/websocketservice.js
    Log Message:
    Hurr.But also, this needs some revision since I'm supposed to sendthe header all at once and probably shouldn't be doing a bunchof individual sendBin calls.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:32 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/282d9bfc5cce8ead3fd456ec
    Modified Files:
    exec/websocketservice.js
    Log Message:
    Build protocol header as string and send all in one big barforama.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:32 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/32238a33cd8b5fd8e951abb0
    Modified Files:
    exec/websocketservice.js
    Log Message:
    Use client address from header
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 19:55:32 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/6bfa4b0b14e08557b2bcd4c9
    Modified Files:
    exec/websocketservice.js
    Log Message:
    Address family must occupy bytes 15 & 16
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Git commit to main/sbbs/master on Sat Nov 27 20:06:52 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/1f52abed6eaf9767813c7e4e
    Modified Files:
    exec/websocketservice.js
    Log Message:
    FWebSocketHeader should just be a bare object.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sun Aug 16 22:55:13 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/d9f3abd619d4bdd8e0a6b8de
    Modified Files:
    exec/websocketservice.js
    Log Message:
    websocketservice.js: name the authenticated web session in the sidecar

    The relay already drops a sidecar file beside each connection so the
    target service can learn the client's real IP, which a service reading
    a proxied socket cannot see for itself. It said where a client came
    from and nothing about who they were, so every browser arrived at the
    far end anonymous, and a service had no way to tell an authenticated
    visitor from a passer-by.

    The Cookie header is captured during the handshake, the session
    resolved against data/user/####.web, and the user number written as a
    second line of the sidecar. A dead or absent session is user zero,
    which is the truthful answer rather than a refusal: what a service does
    with an anonymous client is the service's decision, not the relay's.

    THE ORDERING IS THE GUARANTEE, and it is why this is worth stating in
    the code as well as here. The sidecar is written and closed before a
    single byte is forwarded. So a target service that has been spoken to
    and still finds no sidecar knows it is not talking to the relay at all,
    and can treat that connection as a direct local one. Written after the
    first byte, that inference would be a race, and the fallback for a
    missing sidecar is exactly the trusting one.

    An over-long handshake header line is now refused rather than
    truncated. A line cut at the buffer size leaves its tail to be parsed
    as the NEXT header, which in this file's case can walk a value into the
    slot the user number is read from. Refusing is the only safe reading of
    a line that did not fit.

    -auth is new, and refuses any connection whose sidecar cannot be
    written. Without it a failed write degrades to a connection with no
    sidecar, which is precisely the shape the fallback above treats as
    trusted and local -- a write error turning into an unauthenticated
    client wearing a local client's clothes.

    Backward compatible: without -auth the file keeps its old single-line
    meaning to anything that only reads the first line, and the behaviour
    of every existing caller is unchanged.

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)