Replying to Avatar hzrd149

Doing a little house cleaning today on my "Projects" directory and found this

https://github.com/hzrd149/hyper-http-proxy

Its a HTTP Proxy server for #hyperdht #holepunch.

This would be really cool to finish, because it would allow almost any app to start talking to hyper servers without needing to integrate hyperdht directly. similar to how #tor and #i2p proxies work :)

Unfortunately it has a bug, I wasn't able to get the built-in nodejs socket to connect to the hyperdht socket

This was a learning project for me so I don't really know what I'm doing with sockets and pipes. which is why I never got it working

The bug is here https://github.com/hzrd149/hyper-http-proxy/blob/master/src/agent.ts#L21-L63

Anyways, I don't have time right now to finish this. So if your someone who wants to play with #holepunch or knows a lot about Nodejs then maybe this is a good project to start with?

If no one wants to do it for free (understandable) I'm willing to pay 100k sats to the first person who fixes this project or creates a HTTP proxy that fits these requirements

- Runs on linux and takes less than 3-4 commands to setup

- Runs in docker (needed for start9 and Umbrel)

- Able to proxy HTTP requests to a holesail server

- Easiest way to test this is using "curl .hyper --proxy http://localhost:3128"

- (optional) http auth for the proxy

Reply here or send me a DM if you need more details

nostr:npub1h5t3asu90f2x48rxtcqkjvwhza7m6kngs7vjyanx8xqyswc6es2s4645z5 nostr:npub1h8nk2346qezka5cpm8jjh3yl5j88pf4ly2ptu7s6uu55wcfqy0wq36rpev Id like to get your thoughts on this.

I haven't been keeping up at all on whats being worked on with #pear or #holesail so maybe this is already solved. but I think something like this is a necessary next step to allow apps and users to start using hypercore

Reply to this note

Please Login to reply.

Discussion

nostr:npub1ye5ptcxfyyxl5vjvdjar2ua3f0hynkjzpx552mu5snj3qmx5pzjscpknpr Holesail solves this as holesail is a reverse proxy around hyperdht.

You can check holesail source for how it's Implemented

Yes, but you have to manually connect the tunnels. Also apps have to explicitly integrate hyperdht or holesail in order to connect

If we where able to build a SOCKS5 or HTTP proxy for hyperdht then any app ( mobile apps, desktop browsers, etc ) could access hyper services since most already support proxies for Tor onion services

Holesail integration basically means packing the binary or source and executing it from the app so that your users don't have to.

Any app can use data coming from holesail because it's on your localhost:port .

Yes however i don't think most apps are going to integrate the binary. Just like how most apps don't come with a tor binary

I'm not saying holesails approach with using localhost won't work. Just that if we where able to build a proxy for holesail then any apps that work with tor would immediately work with hyperdht

I think you are a little confused here, apps do not need to integrate holesail to use it.

Holesail in itself is a proxy, it kind of binds two ports between different devices, so apps just need to use localhost:port as the url.

When I say "integrating holesail", I mean including holesail in the app itself so that users don't have to do the installation and running.

For example, for an apache server running on port 80, I can wrap holesail around it with holesail --live 80 --host localhost

Then on another device: holesail --port 3434 --host localhost, now any app on my second device that needs the data from server1, will use the URL http://localhost:3434/

There is no need for manual integration, but for the sake of simplicity and accessibility, it is better to do so.

The above is a manual approach, now if I bundled holesail with apache2 and made it print out a connection key for ever vHOST by default, that would be holesail integration.

Here is a terrible drawing explaining how Holesail proxy works around Hyperdht

I see what your saying. We were talking past each other a bit

I'm talking about automating the second part.

For example if I wanted to host my website or relay over hyperdht then I would use holesail --live 80

However anyone who wants to access it would have to bind it to localhost with a port they choose

That's fine if they are accessing it only once. But they would have to bind the port every time ( every reboot )

So that's what the HTTP proxy is for. It allows apps ( like browsers ) to proxy their traffic through a local server

Which means the HTTP proxy can intercept their requests and bind the ports automatically then forward the traffic through hyperdht to the correct node

I am releasing holesail-manager today It will solve the problem of running holesail commands again and again but what do you mean by:

> Which means the HTTP proxy can intercept their requests and bind the ports automatically then forward the traffic through hyperdht to the correct node

I think I am not able to understand this properly, I appreciate you explaining it, please 🙏.

In the HTTP spec there is support for proxy requests using the CONNECT method

It allows a client to ask the proxy server to open a connection to a remote machine and forward traffic

https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling#http_tunneling

Tor uses something very similar but its a more complicated proxy protocol called SOCKS5

Most apps, browsers and operating systems have support for routing all thier traffic through HTTP or SOCKS5 proxies

This is how tor integrates with so many apps, they aren't specifically integrating with tor. But instead they support routing their traffic through proxies

The local tor proxy ( localhost:9090 ) takes advantage of this and is setup to route all traffic through tor nodes for privacy.

But because its handing all the traffic its also able to let apps connect to .onion domains

When it detects that an app is trying to connect to an .onion domain, instead of routing the traffic out to the clearnet it can make a connection to another tor node

I'm suggesting building something similar for hyperdht

The hyper proxy would watch an apps traffic, then when it detected the app was trying to connect to a .hyper domain, it would make the connection to the remote hyper node and forward the traffic to it

If this worked it would allow users to use any web browser they like ( with a little configuration ) and connect to .hyper domains

Ohhh damn, now I get it lol. That would is pretty amazing. Kind of like a bridge between the browser and holesail