demostanis / gimmeasearx

Find a random searx instance
http://7tcuoi57curagdk7nsvmzedcxgwlrq2d6jach4ksa3vj72uxrzadmqqd.onion/
Other
47 stars 7 forks source link

Unix domain socket support #15

Closed Kobaxidze256 closed 2 years ago

Kobaxidze256 commented 2 years ago

Go standard function net.Listen supports unix domain sockets. Shouldn't be too hard, right? I'm not comfortable with using port 8080 or picking another port. Can systemd unit file be updated as well.

demostanis commented 2 years ago

What do you mean? You want to access the website through a Unix domain socket?

Kobaxidze256 commented 2 years ago

yeah, it's easier to pick a file than a port.

demostanis commented 2 years ago

The website can't be just a file, it's not static.

Kobaxidze256 commented 2 years ago

Sure, but I want to be able to connect to it over a unix domain socket. I can just give a user read/write permissions to it or make a root service filter requests to it, instead of having a random port open that anything can connect to.

demostanis commented 2 years ago

Ah, I get it. I didn't even know HTTP over Unix domain sockets was a thing. I tried to make the code support it, and I was able to connect to gimmeasearx through curl using --unix-socket option. However, I can't access the socket with neither Firefox nor Chromium: image That seems like a very weird issue, why don't you just use a firewall? Gimmeasearx binds to 127.0.0.1 by default anyway, not even 0.0.0.0.

Kobaxidze256 commented 2 years ago

I was thinking about hosting it on my vps on a subdomain through nginx and possibly protecting it with a password similar to other services i have running.

demostanis commented 2 years ago

Isn't that doable with TCP..?

Kobaxidze256 commented 2 years ago

Probably, but I'd prefer a unix socket.

demostanis commented 2 years ago

Feel free to fork the code and make the adequate changes.