dolu89 / nostr-proxy Goto Github PK
View Code? Open in Web Editor NEWNostr proxy: save you WS connections
Home Page: https://nproxy.cc
License: MIT License
Nostr proxy: save you WS connections
Home Page: https://nproxy.cc
License: MIT License
NDK is a great tool and have a solid bases. Let's see if it can replace the current pool in a better way
Proxy should be like a relay with connection limitation.
Also limiting clients connected to the proxy can reduce REQ limit to relays. (not perfect)
Adding NIP 42 to restrict people using a public instance of Nostr proxy.
Add authorized pubkeys in an env variable.
An idea for later: A paywall can be added, like nostream, to allow new members.
Followed readme instructions and everything built but this:
npm install
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:@noble/hashes/sha256
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rabble/.npm/_logs/2023-03-01T21_22_05_923Z-debug-0.log
pnpm install
Lockfile is up to date, resolution step is skipped
Already up to date
β> WARNβ Local dependency not found at /Users/rabble/code/experiments/nostr-proxy/@noble/hashes/sha256
Done in 1.1s
At start, Nostr proxy should push a NIP-65 event with all relays that are configured in the proxy.
Once it's done, your client can be connected to only your proxy, but other people now know that you are listening/pushing events to these relays, not from your personal proxy.
Add NIP 11. Indicate that it's a proxy, not a relay.
https://github.com/nostr-protocol/nips/blob/master/11.md
There are two thing going on with the footer:
This causes overlap of the footer with the relay list with longer lists (~30 relays) and on mobile views. It can be resolved by removing position: absolute, but I think the intent is position: sticky.
This is only a problem on mobile views . The input.copy-text bleeds outside of the container because it gets a larger width than the container.
Proxy seems to be working, but it outputs lots of errors like these:
Feb 17 14:26:47 106310-h-box node[149621]: TypeError: Cannot read property 'sendUTF' of undefined
Feb 17 14:26:47 106310-h-box node[149621]: at WebSocket.send (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/websocket-polyfill/lib/WebSocket.js:72:30)
Feb 17 14:26:47 106310-h-box node[149621]: at trySend (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:427:10)
Feb 17 14:26:47 106310-h-box node[149621]: at Object.unsub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:454:9)
Feb 17 14:26:47 106310-h-box node[149621]: at /home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:627:35
Feb 17 14:26:47 106310-h-box node[149621]: at Array.forEach (<anonymous>)
Feb 17 14:26:47 106310-h-box node[149621]: at Object.unsub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:627:14)
Feb 17 14:26:47 106310-h-box node[149621]: at WebSocket.<anonymous> (/home/nproxy/nostr-proxy/app/Services/NostrSocket.ts:92:62)
Feb 17 14:26:47 106310-h-box node[149621]: at WebSocket.emit (events.js:400:28)
Feb 17 14:26:47 106310-h-box node[149621]: at Receiver.receiverOnMessage (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/ws/lib/websocket.js:1180:20)
Feb 17 14:26:47 106310-h-box node[149621]: at Receiver.emit (events.js:400:28)
Feb 17 14:26:47 106310-h-box node[149621]: TypeError: Cannot read property 'sendUTF' of undefined
Feb 17 14:26:47 106310-h-box node[149621]: at WebSocket.send (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/websocket-polyfill/lib/WebSocket.js:72:30)
Feb 17 14:26:47 106310-h-box node[149621]: at trySend (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:427:10)
Feb 17 14:26:47 106310-h-box node[149621]: at Object.sub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:444:5)
Feb 17 14:26:47 106310-h-box node[149621]: at /home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:603:17
Feb 17 14:26:47 106310-h-box node[149621]: at runMicrotasks (<anonymous>)
Feb 17 14:26:47 106310-h-box node[149621]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
Feb 17 14:26:50 106310-h-box node[149621]: TypeError: Cannot read property 'sendUTF' of undefined
Feb 17 14:26:50 106310-h-box node[149621]: at WebSocket.send (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/websocket-polyfill/lib/WebSocket.js:72:30)
Feb 17 14:26:50 106310-h-box node[149621]: at trySend (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:427:10)
Feb 17 14:26:50 106310-h-box node[149621]: at Object.unsub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:454:9)
Feb 17 14:26:50 106310-h-box node[149621]: at /home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:627:35
Feb 17 14:26:50 106310-h-box node[149621]: at Array.forEach (<anonymous>)
Feb 17 14:26:50 106310-h-box node[149621]: at Object.unsub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:627:14)
Feb 17 14:26:50 106310-h-box node[149621]: at WebSocket.<anonymous> (/home/nproxy/nostr-proxy/app/Services/NostrSocket.ts:92:62)
Feb 17 14:26:50 106310-h-box node[149621]: at WebSocket.emit (events.js:400:28)
Feb 17 14:26:50 106310-h-box node[149621]: at Receiver.receiverOnMessage (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/ws/lib/websocket.js:1180:20)
Feb 17 14:26:50 106310-h-box node[149621]: at Receiver.emit (events.js:400:28)
Feb 17 14:27:38 106310-h-box node[149621]: TypeError: Cannot read property 'sendUTF' of undefined
Feb 17 14:27:38 106310-h-box node[149621]: at WebSocket.send (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/websocket-polyfill/lib/WebSocket.js:72:30)
Feb 17 14:27:38 106310-h-box node[149621]: at trySend (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:427:10)
Feb 17 14:27:38 106310-h-box node[149621]: at Object.sub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:444:5)
Feb 17 14:27:38 106310-h-box node[149621]: at /home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:603:17
Feb 17 14:27:38 106310-h-box node[149621]: at runMicrotasks (<anonymous>)
Feb 17 14:27:38 106310-h-box node[149621]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
Feb 17 14:27:38 106310-h-box node[149621]: TypeError: Cannot read property 'sendUTF' of undefined
Feb 17 14:27:38 106310-h-box node[149621]: at WebSocket.send (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/websocket-polyfill/lib/WebSocket.js:72:30)
Feb 17 14:27:38 106310-h-box node[149621]: at trySend (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:427:10)
Feb 17 14:27:38 106310-h-box node[149621]: at Object.unsub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:454:9)
Feb 17 14:27:38 106310-h-box node[149621]: at /home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:627:35
Feb 17 14:27:38 106310-h-box node[149621]: at Array.forEach (<anonymous>)
Feb 17 14:27:38 106310-h-box node[149621]: at Object.unsub (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/nostr-tools/lib/nostr.cjs.js:627:14)
Feb 17 14:27:38 106310-h-box node[149621]: at WebSocket.<anonymous> (/home/nproxy/nostr-proxy/app/Services/NostrSocket.ts:92:62)
Feb 17 14:27:38 106310-h-box node[149621]: at WebSocket.emit (events.js:400:28)
Feb 17 14:27:38 106310-h-box node[149621]: at Receiver.receiverOnMessage (/home/nproxy/nostr-proxy/build/node_modules/.pnpm/[email protected]/node_modules/ws/lib/websocket.js:1180:20)
Feb 17 14:27:38 106310-h-box node[149621]: at Receiver.emit (events.js:400:28)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.