Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

功能增加:ip限速 #30

Closed
steamsv opened this issue Apr 12, 2022 · 14 comments
Closed

功能增加:ip限速 #30

steamsv opened this issue Apr 12, 2022 · 14 comments

Comments

@steamsv
Copy link

steamsv commented Apr 12, 2022

能够对每个来源ip进行限速

@enp6
Copy link

enp6 commented Apr 13, 2022

对用户进行限速和限制连接数更好

@sxchxdc
Copy link

sxchxdc commented Sep 5, 2022

同求,对每个来源IP限制速度或者连接数。

@ginuerzh
Copy link
Member

ginuerzh commented Sep 5, 2022

@benyamin218118
Copy link

its not working :
gost -L=ss://AES-256-GCM:password@:4444?limiter.conn.out=250KB&limiter.conn.in=250KB&limiter.in=250KB&limiter.out=250KB
i can download up to my bandwidth
for example 3 MB per seconds.

@benyamin218118
Copy link

hello? any news on this?

@ginuerzh
Copy link
Member

ginuerzh commented Nov 1, 2022

Maybe you need to add quotes:

gost -L="ss://AES-256-GCM:password@:4444?limiter.conn.out=250KB&limiter.conn.in=250KB&limiter.in=250KB&limiter.out=250KB"

You can confirm the command by using the '-O yaml':

gost -L="ss://AES-256-GCM:password@:4444?limiter.conn.out=250KB&limiter.conn.in=250KB&limiter.in=250KB&limiter.out=250KB" -O yaml

Outputs:

services:
- name: service-0
  addr: :4444
  limiter: limiter-0
  handler:
    type: ss
    auth:
      username: AES-256-GCM
      password: password
  listener:
    type: tcp
limiters:
- name: limiter-0
  limits:
  - $ 250KB 250KB
  - $$ 250KB 250KB

@benyamin218118
Copy link

thank you @ginuerzh for the reply, i will try this

@benyamin218118
Copy link

hi @ginuerzh
i just tested again

it looks like its just not working when you use -F=...

for example this works :
gost -L="ss://AES-256-GCM:password@:4444?limiter.conn.out=250KB&limiter.conn.in=250KB&limiter.in=250KB&limiter.out=250KB"

but this one doesn't works :

gost -L="ss://AES-256-GCM:password@:4444?limiter.conn.out=250KB&limiter.conn.in=250KB&limiter.in=250KB&limiter.out=250KB" -F=ss://AES-256-GCM:password@server2.com:4442

@benyamin218118
Copy link

so that's how it supposed to work or its a bug?

@zero0o07
Copy link

zero0o07 commented Mar 8, 2023

how to testing the limiter is work?

using fast.com to testing, the download speed limited , but the upload speed limiter is not work, setup as below

- name: limiter-0
  limits:
  - '$ 2MB 2MB'
  - '$$ 2MB 2MB '

fast.com result
2023-03-08 12 56 44

I want to limit the download speed how to set, or how to testing the limiter (input/output) setting is work,

thanks

@xzycn
Copy link

xzycn commented Mar 8, 2023

@zero0o07
You should post the complete configuration you are using here.
Do you just create a limiter named "limiter-0", but do not assign it to a service?

@zero0o07
Copy link

zero0o07 commented Mar 8, 2023

@zero0o07 You should post the complete configuration you are using here. Do you just create a limiter named "limiter-0", but do not assign it to a service?

the details as below:

services:
- name: service-0
  addr: ":8888"
  interface: 100.100.100.194
  limiter: limiter-0
  handler:
    type: auto
    auther: auther-0
  listener:
    type: tcp
authers:
- name: auther-0
  auths:
  - username: UNAME
    password: UPWD
limiters:
- name: limiter-0
  limits:
  - $ 2MB 2MB
  - $$ 2MB 2MB

100.100.100.194 is a fake address,

socks://UNAME:UPWD@100.100.100.194:8888
or
http://UNAME:UPWD@100.100.100.194:8888

@xzycn
Copy link

xzycn commented Mar 8, 2023

@zero0o07
The key point for this problem is that they are different unit.
1 MB = 1Mb * 8, so you should set like this:

limits:
  - $ 0.25MB 0.25MB
  - $$ 0.25MB 0.25MB

@ginuerzh
Copy link
Member

You can use the scp command to test the limiter:

Proxy mode:

gost -L ":8080?limiter.conn.in=1MB&limiter.conn.out=2MB&limiter.in=1MB&limiter.out=2MB"

test upload:

scp -o "ProxyCommand=nc -X connect -x localhost:8080 %h %p" ./test.dat user@localhost:~

test download:

scp -o "ProxyCommand=nc -X connect -x localhost:8080 %h %p" user@localhost:~/test.dat .

Port forwarding mode

gost -L "tcp://:2222/:22?limiter.conn.in=1MB&limiter.conn.out=2MB&limiter.in=1MB&limiter.out=2MB"

test upload:

scp -P 2222 ./test.dat user@localhost:~

test download:

scp -P 2222 user@localhost:~/test.dat .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants