mirror of
https://github.com/Yonle/bostr.git
synced 2025-09-28 22:02:29 +02:00
connect to relays with user-agent
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user