Tidy up
This commit is contained in:
parent
449f6459b3
commit
6cc9d78057
|
@ -0,0 +1,3 @@
|
||||||
|
/example/proxies.txt
|
||||||
|
/example/socks.list
|
||||||
|
/example/socksold.list
|
|
@ -1,14 +1,17 @@
|
||||||
## Prox5
|
## Prox5
|
||||||
|
|
||||||
[![GoDoc](https://godoc.org/git.tcp.direct/kayos/Prox5?status.svg)](https://godoc.org/git.tcp.direct/kayos/Prox5) [![Go Report Card](https://goreportcard.com/badge/github.com/yunginnanet/Prox5)](https://goreportcard.com/report/github.com/yunginnanet/Prox5) [![IRC](https://img.shields.io/badge/ircd.chat-%23tcpdirect-blue.svg)](ircs://ircd.chat:6697/#tcpdirect)
|
[![GoDoc](https://godoc.org/git.tcp.direct/kayos/Prox5?status.svg)](https://godoc.org/git.tcp.direct/kayos/Prox5) [![Go Report Card](https://goreportcard.com/badge/github.com/yunginnanet/Prox5)](https://goreportcard.com/report/github.com/yunginnanet/Prox5) [![IRC](https://img.shields.io/badge/ircd.chat-%23tcpdirect-blue.svg)](ircs://ircd.chat:6697/#tcpdirect)
|
||||||
|
|
||||||
### SOCKS5/4/4a validating proxy pool
|
### SOCKS5/4/4a validating proxy pool
|
||||||
|
|
||||||
![Demo](./Prox5.gif)
|
![Demo](./Prox5.gif)
|
||||||
|
|
||||||
This package is for managing and accessing thousands upon thousands of arbitrary SOCKS proxies.
|
This package is for managing and accessing thousands upon thousands of arbitrary SOCKS proxies.
|
||||||
|
|
||||||
It also has a SOCKS5 server that dials out from ***?????*** Every time you ***?????***.
|
It also has a SOCKS5 server that dials out from ***?????*** Every time you ***?????***.
|
||||||
|
|
||||||
Pipe it a file filled with SOCKS proxies (host:port per line) and it will validate them continously while automatically weeding out the invalid ones.
|
Pipe it a file filled with SOCKS proxies (host:port per line) and it will validate them continously while automatically
|
||||||
|
weeding out the invalid ones.
|
||||||
|
|
||||||
This project is in development.
|
This project is in development.
|
||||||
|
|
||||||
|
|
6
defs.go
6
defs.go
|
@ -206,10 +206,10 @@ func NewDefaultSwamp() *Swamp {
|
||||||
|
|
||||||
swampopt: defOpt(),
|
swampopt: defOpt(),
|
||||||
|
|
||||||
quit: make(chan bool),
|
quit: make(chan bool),
|
||||||
conductor: make(chan bool),
|
conductor: make(chan bool),
|
||||||
mu: &sync.RWMutex{},
|
mu: &sync.RWMutex{},
|
||||||
Status: atomic.Value{},
|
Status: atomic.Value{},
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Status.Store(New)
|
s.Status.Store(New)
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
|
|
||||||
var swamp *Prox5.Swamp
|
var swamp *Prox5.Swamp
|
||||||
var quit chan bool
|
var quit chan bool
|
||||||
|
var t *tty.TTY
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
quit = make(chan bool)
|
quit = make(chan bool)
|
||||||
|
@ -50,7 +51,8 @@ func get(ver string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func watchKeyPresses() {
|
func watchKeyPresses() {
|
||||||
t, err := tty.Open()
|
var err error
|
||||||
|
t, err = tty.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -104,7 +106,6 @@ func watchKeyPresses() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Close()
|
|
||||||
quit <- true
|
quit <- true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -112,6 +113,10 @@ func watchKeyPresses() {
|
||||||
func main() {
|
func main() {
|
||||||
go watchKeyPresses()
|
go watchKeyPresses()
|
||||||
|
|
||||||
|
defer func(t *tty.TTY) {
|
||||||
|
_ = t.Close()
|
||||||
|
}(t)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
fmt.Printf("4: %d, 4a: %d, 5: %d \n", swamp.Stats.Valid4, swamp.Stats.Valid4a, swamp.Stats.Valid5)
|
fmt.Printf("4: %d, 4a: %d, 5: %d \n", swamp.Stats.Valid4, swamp.Stats.Valid4a, swamp.Stats.Valid5)
|
||||||
|
|
|
@ -47,12 +47,12 @@ func (s *Swamp) SetMaxWorkers(num int) {
|
||||||
s.pool.Tune(num)
|
s.pool.Tune(num)
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableRecycling disables recycling used proxies back into the pending channel for revalidation after dispensed.
|
// EnableRecycling enables recycling used proxies back into the pending channel for revalidation after dispensed.
|
||||||
func (s *Swamp) EnableRecycling() {
|
func (s *Swamp) EnableRecycling() {
|
||||||
s.swampopt.recycle.Store(true)
|
s.swampopt.recycle.Store(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableRecycling enables recycling used proxies back into the pending channel for revalidation after dispensed.
|
// DisableRecycling disables recycling used proxies back into the pending channel for revalidation after dispensed.
|
||||||
func (s *Swamp) DisableRecycling() {
|
func (s *Swamp) DisableRecycling() {
|
||||||
s.swampopt.recycle.Store(false)
|
s.swampopt.recycle.Store(false)
|
||||||
}
|
}
|
||||||
|
|
10
util.go
10
util.go
|
@ -32,13 +32,3 @@ func randSleep() {
|
||||||
quiccmaffs.Seed(time.Now().UnixNano())
|
quiccmaffs.Seed(time.Now().UnixNano())
|
||||||
time.Sleep(time.Duration(quiccmaffs.Intn(500)) * time.Millisecond)
|
time.Sleep(time.Duration(quiccmaffs.Intn(500)) * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*func allNil(obj ...interface{}) bool {
|
|
||||||
for _, o := range obj {
|
|
||||||
if o != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in New Issue