nostr-rs-relay icon indicating copy to clipboard operation
nostr-rs-relay copied to clipboard

nostr-rs-relay is not listenning on any tcp port so no wss port ,but only on unix-socket

Open emacsenli opened this issue 10 months ago • 1 comments

bin file is compiled from src by myself, and running as following : RUST_LOG=debug,nostr_rs_relay=debug ./nostr-rs-relay --config ./config.toml 2024-04-03T02:03:04.501789Z INFO nostr_rs_relay: Starting up from main 2024-04-03T02:03:04.507588Z INFO nostr_rs_relay::server: listening on: 127.0.0.1:8080 2024-04-03T02:03:04.513763Z INFO nostr_rs_relay::repo::sqlite: Built a connection pool "writer" (min=0, max=2) 2024-04-03T02:03:04.515892Z INFO nostr_rs_relay::repo::sqlite: Built a connection pool "maintenance" (min=0, max=2) 2024-04-03T02:03:04.519662Z INFO nostr_rs_relay::repo::sqlite: Built a connection pool "reader" (min=4, max=8) 2024-04-03T02:03:04.521065Z INFO nostr_rs_relay::repo::sqlite_migration: DB version = 18 2024-04-03T02:03:04.521196Z DEBUG nostr_rs_relay::repo::sqlite_migration: SQLite max query parameters: 32766 2024-04-03T02:03:04.521214Z DEBUG nostr_rs_relay::repo::sqlite_migration: SQLite max table/blob/text length: 953 MB 2024-04-03T02:03:04.521222Z DEBUG nostr_rs_relay::repo::sqlite_migration: SQLite max SQL length: 953 MB 2024-04-03T02:03:04.521229Z DEBUG nostr_rs_relay::repo::sqlite_migration: Database version was already current (v18) 2024-04-03T02:03:04.521286Z DEBUG nostr_rs_relay::repo::sqlite_migration: SQLite PRAGMA startup completed 2024-04-03T02:03:04.521473Z INFO nostr_rs_relay::server: db writer created 2024-04-03T02:03:04.522488Z DEBUG nostr_rs_relay::db: Pay to relay: false 2024-04-03T02:03:04.522782Z INFO nostr_rs_relay::server: control message listener started

but noscl failed to connect to 127.0.0.1:8080 port , └──╼ $./noscl publish "helloworld" <> 2024/04/03 10:04:48 error adding relay '127.0.0.1:8080': error opening websocket to 'wss://127.0.0.1:8080': tls: first record does not look like a TLS handshake <> 2024/04/03 10:04:48 You have zero relays configured, everything will probably fail.

while netstat -np | grep nostr shows nostr-rs-relay is not listennning on any tcp/udp port └──╼ $sudo netstat -np| grep nostr

        unix  3      [ ]         STREAM     CONNECTED     1096961  460366/./nostr-rs-r  
        unix  3      [ ]         STREAM     CONNECTED     1096962  460366/./nostr-rs-r  

emacsenli avatar Apr 03 '24 02:04 emacsenli

netstat is deprecated, so I'll give an example here with ss. In either case, you need to use the -l flag to show listening sockets.

$ ss -tpln src :8080
State          Recv-Q         Send-Q                 Local Address:Port                 Peer Address:Port        Process        
LISTEN         0              128                        127.0.0.1:8080                      0.0.0.0:*            users:(("nostr-rs-relay",pid=1228386,fd=24))

I think the real problem is that noscl looks like it is trying to use the WSS protocol (websockets over TLS), but nostr-rs-relay only speaks plain websockets, and expects you to setup TLS termination separately (using a tool like haproxy).

scsibug avatar Apr 03 '24 02:04 scsibug