mirror of
https://github.com/Yonle/bostr.git
synced 2025-10-06 14:11:03 +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
|
// WS - Sessions
|
||||||
function newConn(addr) {
|
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.addr = addr;
|
||||||
relay.on('open', _ => {
|
relay.on('open', _ => {
|
||||||
|
@@ -104,7 +104,11 @@ function terminate_sess(id) {
|
|||||||
// WS - Sessions
|
// WS - Sessions
|
||||||
function newConn(addr, id) {
|
function newConn(addr, id) {
|
||||||
if (!csess.has(id)) return;
|
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.id = id;
|
||||||
relay.addr = addr;
|
relay.addr = addr;
|
||||||
|
Reference in New Issue
Block a user