ProxyChains4 now available to Haiku!

Hey all,

so around one year ago, I posted a topic here complaining about inability of setting proxy server for apps (e.g HaikuDepot). Today I ported proxychains-ng to Haiku and that works!

To install and configure proxychains, just follow the instructions in README file.

Besides this port also ships a simple wrapper script to force any app use proxy:
For examples:

  1. To force HaikuDepot access internet through proxy
    launch_app.sh HaikuDepot
  2. To force WebPositive use proxy (DNS will be resolved remotely)
    launch_app.sh WebPositive
  3. To force Otter-Browser use proxy (DNS will be resolved remotely)
    launch-app.sh Otter-Browser/Otter-Browser

=========================
I noticed that what proxychains actually does is to hijack the system library at runtime and replace certain network related functions with it’s own ones. And I think system-wide proxy can be possible by adopting this strategie.

So the following system functions have to be changed:
connect(), sendto(), close(), gethostbyname(), getaddrinfo(), freeaddrinfo(),
gethostbyaddr(), getnameinfo()

A new option in Network Manager:
Network->Services->Proxy settings

…

Best regards

UPDATE1:
A pull request has been made to the original repository (https://github.com/rofl0r/proxychains-ng)

3 Likes

There is a wip PR atm at https://github.com/haikuports/haikuports/pull/5212
not sure is its based on the same :slightly_smiling_face:

No, it’s not. Mine is actually a clean fork from the original one. That’s why I name it proxychains-haiku. Certain changes are necessary to make it compile and run on Haiku.

His patch does not reflect those critical changes. And the compilation should failed due to conflict function definition.

Could you create a recipe for it based on your work?

Yeah, sure thing :slightly_smiling_face:

1 Like

You really want to try and make your work acceptable upstream… Importing a random version as “initial commit” in a git repo is probably not the cleanest way.

Can’t you fork the original and work from there? It’s way easier to make patches, rebase and all the stuff… Even if you don’t want to have a github account having proper patches that apply to it means someone else can fork it there and make a pull-request with your work.

1 Like

Thanks for the suggestion. I just created a new github account and set it up on my haiku machine :slight_smile:

3 Likes

Latest commit checkout has been imported into the existing PR, I still used the patch included at haikuports as Beta2 didn’t get an update on that fix, packages can be installed over HaikuDepot and/or pkgman (in Terminal), I left some comments on the Haiku fix at their github account, would be nice if someone with a working proxy could check this out and comment on it.