gost icon indicating copy to clipboard operation
gost copied to clipboard

功能增加:ip限速

Open steamsv opened this issue 2 years ago • 3 comments

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

steamsv avatar Apr 12 '22 05:04 steamsv

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

enp6 avatar Apr 13 '22 15:04 enp6

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

sxchxdc avatar Sep 05 '22 11:09 sxchxdc

https://gost.run/concepts/limiter/

ginuerzh avatar Sep 05 '22 15:09 ginuerzh

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 avatar Oct 13 '22 17:10 benyamin218118

hello? any news on this?

benyamin218118 avatar Oct 30 '22 10:10 benyamin218118

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

ginuerzh avatar Nov 01 '22 12:11 ginuerzh

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

benyamin218118 avatar Nov 04 '22 20:11 benyamin218118

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:[email protected]:4442

benyamin218118 avatar Nov 04 '22 20:11 benyamin218118

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

benyamin218118 avatar Jan 27 '23 14:01 benyamin218118

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

zero0o07 avatar Mar 08 '23 04:03 zero0o07

@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?

xzycn avatar Mar 08 '23 07:03 xzycn

@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:[email protected]:8888 or http://UNAME:[email protected]:8888

zero0o07 avatar Mar 08 '23 08:03 zero0o07

@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

xzycn avatar Mar 08 '23 09:03 xzycn

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 .

ginuerzh avatar Mar 21 '23 10:03 ginuerzh