Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
bouncer connection to relays: tell ConnID in header
Browse files Browse the repository at this point in the history
This commit will expose ConnID in User-Agent HTTP Header on connection to upstream
relays. The ConnID is only an random string that only the bostr admin
knows what IP it does belong. This random string is always changing and
will never give the same ID on every single connections, So please do
not take this to be a similiar thing like X-Real-IP.

The ConnID won't reveal client IP to upstream relay due to how the
bouncer technically works, But it will help on both parties to finding the
culprit.

Only the respective bostr owner / admin know what IP does this ConnIDs
belong.

- To report an suspected service abuse, Contact to the bostr admin.
  Make sure that you send atleast more than a single log of ConnID.
  Please remember that these ConnIDs is not always the same.
  So sending more log about ConnIDs will help bostr admin to figure out
  the culprit.

- For bostr admins, Finding out the culprit is easy.
  In your bostr log:

  1 --- xxx.xxx.xxx.xxx is now using session 171629xxxxxxx_1_0.503985444xxxxxxx
               ^                                             ^
               |                                             |
            Culprit                                        ConnID

Signed-off-by: Yonle <yonle@lecturify.net>
  • Loading branch information
Yonle committed May 21, 2024
1 parent b99795f commit 014d469
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worker_bouncer.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function newConn(addr, id, reconn_t = 0) {
if (!stats[addr]) stats[addr] = { raw_rx: 0, rx: 0, tx: 0, f: 0 };
const relay = new WebSocket(addr, {
headers: {
"User-Agent": `Bostr ${version}; The nostr relay bouncer; https://github.com/Yonle/bostr; ${server_meta.canonical_url || "No canonical bouncer URL specified"}; Contact: ${server_meta.contact}`,
"User-Agent": `Bostr ${version}; The nostr relay bouncer; https://github.com/Yonle/bostr; ConnID: ${id}; ${server_meta.canonical_url || "No canonical bouncer URL specified"}; Contact: ${server_meta.contact}`,
}
});

Expand Down

0 comments on commit 014d469

Please sign in to comment.