mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-18 05:42:03 +01:00
connect to relays with user-agent
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
db94aa162a
commit
b7a513be56
@ -88,7 +88,11 @@ function bc(msg) {
|
||||
|
||||
// WS - Sessions
|
||||
function newConn(addr) {
|
||||
const relay = new WebSocket(addr);
|
||||
const relay = new WebSocket(addr, {
|
||||
headers: {
|
||||
"User-Agent": "Bostr; The nostr relay bouncer; https://github.com/Yonle/bostr"
|
||||
}
|
||||
});
|
||||
|
||||
relay.addr = addr;
|
||||
relay.on('open', _ => {
|
||||
|
@ -104,7 +104,11 @@ function terminate_sess(id) {
|
||||
// WS - Sessions
|
||||
function newConn(addr, id) {
|
||||
if (!csess.has(id)) return;
|
||||
const relay = new WebSocket(addr);
|
||||
const relay = new WebSocket(addr, {
|
||||
headers: {
|
||||
"User-Agent": "Bostr; The nostr relay bouncer; https://github.com/Yonle/bostr"
|
||||
}
|
||||
});
|
||||
|
||||
relay.id = id;
|
||||
relay.addr = addr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user