serjs / socks5-server

668 stars 165 forks source link

Multiples users passwords support #4

Open shtirlic opened 6 years ago

shtirlic commented 6 years ago

I would be a great to provide list of users/password, AFAIK go-socks5 supports this https://github.com/armon/go-socks5/blob/master/credentials_test.go

serjs commented 6 years ago

I need some time to look into this feature request. Current server.go based on env variables config, for supporting multi-accounts feature we need to use some custom structure or use file with accounts config maybe

rezzorix commented 2 years ago

Hey @serjs really like your container.

Did you already have time to look into multiple user authentication? Would be a great addition.

Abbode commented 6 months ago

Or, it'd be better integrating LDAP server authentication and authorization

alexng353 commented 5 months ago

Did you already have time to look into multiple user authentication?

Adding multiple-user authentication is not super difficult. I am wondering though, how would you like to see it implemented when the only inputs we can pass to the docker container are strings.

I have written it so that you pass in the environment variable PROXY_CREDENTIALS as a JSON stringified array of username-password pairs:

[
    { "username": "username1", "password": "password123" },
    { "username": "username2", "password": "password456" }
]

You can check it out at https://github.com/alexng353/socks5-server/ if you want. It's just a few lines of code, but I will make a pull request into this repository if this is an acceptable way to do multi-user authentication for this app.

As a side note, the maintainer of the go-socks5 repository seems to have moved on from the project...

Abbode commented 4 months ago

I am wondering though, how would you like to see it implemented

My friend, the best way is with sqlite, if the code is written in python I can help you, as I have experience. If it's not and you don't want to dive into it, use a JSON file.

alexng353 commented 4 months ago

My friend, the best way is with sqlite,

https://github.com/alexng353/ihostproxy

I eventually ended up doing it with SQLite. I am planning on continuing this project when I have time, but I don't know if I'll ever be able to compete with the de-facto socks5-server haha. If you have any suggestions for my new "fully manageable" proxy project, go ahead and leave an issue. I'll get to it as soon as I have the time.

Abbode commented 4 months ago

"Fully manageable" not yet, but I'm working on something now, commercial, I hope to monetize it by giving good service and high speeds multiple configurations proxy.

If you want we can jointly build and scale it. I also have a brother who makes apps, we can all work together.