Spork is all about creating forward and reverse proxies between traditional sockets and p2p sockets.
Let's say we have a web app running at
$ npx serve -p 8080
We can put this on the p2p network by calling
$ spork bind -p 8080====================== Spork powers ACTIVATED - Mode: Reverse proxy - Listening on whattzzuu5drxwdwi6xbijjf7yt56l5adzht7j7kjvfped7amova - Proxying all traffic to localhost:8080 ======================
As long as that spork command is running, our web app will be available at
Let's say somebody has sporked their web app onto the p2p net at the pubkey
We can create a local proxy to that app using
$ spork bind whattzzuu5drxwdwi6xbijjf7yt56l5adzht7j7kjvfped7amova -p 5555====================== Spork powers ACTIVATED - Mode: Forward proxy - Listening on localhost:5555 - Proxying all traffic to whattzzuu5drxwdwi6xbijjf7yt56l5adzht7j7kjvfped7amova ======================
Now we can access that server
localhost:5555. Note: The connection is end-to-end encrypted!
If end-to-end encryption isn't important for your use-case, you can also use the public gateway at atek.app.
Serve a folder as a static website quickly with
$ spork serve .====================== Spork powers ACTIVATED - Mode: Serve folder via HTTP - Serving /Users/bob/my-website ====================== Links: http://localhost:15034/ https://ckj7w33lzx6wbxqk53n3evbgwvoykrc3xesw2kwsfwuwua4doxiq.atek.app/
Run an open HTTP gateway to p2p sockets with the
spork gatewaycommand.$ spork gateway -p 6666====================== Spork powers ACTIVATED - Mode: Gateway - Listening on localhost:6666 - Proxing by subdomain to p2p sockets ======================
Now we can access any socket at
Create an encrypted network pipe between two devices with the
On device 1:$ echo "Hello, world!" | spork beam▶ Run the following command to connect: ▶ spork beam 5hbdbh7octaexk4o3amftc4r4xcsdr2fkiloinj7sbihm6svb2ea
On device 2:$ spork beam 5hbdbh7octaexk4o3amftc4r4xcsdr2fkiloinj7sbihm6svb2eaHello, world!