This commit is contained in:
kayos@tcp.direct 2021-10-26 19:51:14 -07:00
parent 449f6459b3
commit 6cc9d78057
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
6 changed files with 20 additions and 19 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/example/proxies.txt
/example/socks.list
/example/socksold.list

View File

@ -1,5 +1,7 @@
## 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)
### SOCKS5/4/4a validating proxy pool
![Demo](./Prox5.gif)
@ -8,7 +10,8 @@ This package is for managing and accessing thousands upon thousands of arbitrary
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.

View File

@ -13,6 +13,7 @@ import (
var swamp *Prox5.Swamp
var quit chan bool
var t *tty.TTY
func init() {
quit = make(chan bool)
@ -50,7 +51,8 @@ func get(ver string) {
}
func watchKeyPresses() {
t, err := tty.Open()
var err error
t, err = tty.Open()
if err != nil {
panic(err)
}
@ -104,7 +106,6 @@ func watchKeyPresses() {
}
}
t.Close()
quit <- true
return
}
@ -112,6 +113,10 @@ func watchKeyPresses() {
func main() {
go watchKeyPresses()
defer func(t *tty.TTY) {
_ = t.Close()
}(t)
go func() {
for {
fmt.Printf("4: %d, 4a: %d, 5: %d \n", swamp.Stats.Valid4, swamp.Stats.Valid4a, swamp.Stats.Valid5)

View File

@ -47,12 +47,12 @@ func (s *Swamp) SetMaxWorkers(num int) {
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() {
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() {
s.swampopt.recycle.Store(false)
}

10
util.go
View File

@ -32,13 +32,3 @@ func randSleep() {
quiccmaffs.Seed(time.Now().UnixNano())
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
}
*/