Skip to content

Commit

Permalink
Merge pull request #57 from shoriwe/gplasma-v1.01-adoption
Browse files Browse the repository at this point in the history
Plasma v1 adoption
  • Loading branch information
shoriwe committed Aug 23, 2022
2 parents 879cf0a + 5658709 commit 091a1a2
Show file tree
Hide file tree
Showing 249 changed files with 11,879 additions and 13,178 deletions.
12 changes: 6 additions & 6 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,16 @@ func (r *runner) loadSniffers(incoming, outgoing string) (i io.WriteCloser, o io
func (r *runner) loadFilters(filters Filters) listeners.Filters {
listenerFilter := &filter{}
if f, found := r.drivers[filters.Inbound]; found {
listenerFilter.inbound = f.inbound
listenerFilter.inbound = f.Inbound
}
if f, found := r.drivers[filters.Outbound]; found {
listenerFilter.outbound = f.outbound
listenerFilter.outbound = f.Outbound
}
if f, found := r.drivers[filters.Listen]; found {
listenerFilter.listen = f.listen
listenerFilter.listen = f.Listen
}
if f, found := r.drivers[filters.Accept]; found {
listenerFilter.accept = f.accept
listenerFilter.accept = f.Accept
}
return listenerFilter
}
Expand Down Expand Up @@ -338,8 +338,8 @@ func (r *runner) startConfig(c YAML) {
)
log.Print("Loading drivers")
r.drivers = map[string]*Driver{}
for name, script := range c.Drivers {
r.drivers[name], err = loadDriver(script)
for name, scriptCode := range c.Drivers {
r.drivers[name], err = r.loadDriver(scriptCode)
if err != nil {
printAndExit(err.Error(), 1)
}
Expand Down
18 changes: 9 additions & 9 deletions debug/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ def test_socks5_with_http_no_auth():


def test_socks5_with_http_with_file_auth():
#assert requests.get(
# "http://127.0.0.1:8080",
# proxies={
# "http": "socks5://sulcud:password@127.0.0.1:9050",
# "https": "socks5://sulcud:password@127.0.0.1:9050"
# }
#)
# assert requests.get(
# "http://127.0.0.1:8000",
# proxies={
# "http": "socks5://sulcud:password@127.0.0.1:9050",
# "https": "socks5://sulcud:password@127.0.0.1:9050"
# }
# )
assert requests.get(
"https://google.com",
proxies={
Expand All @@ -77,8 +77,8 @@ def main():

# test_socks5_with_http_no_auth()

test_http_with_http_no_auth()
# test_socks5_with_http_with_file_auth()
#test_http_with_http_no_auth()
test_socks5_with_http_with_file_auth()


if __name__ == '__main__':
Expand Down
20 changes: 10 additions & 10 deletions docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document describe the interfaces used in `fullproxy` driver development.

## Authentication functions

Functions intended for authentication will be loaded using `SetAuth(function)`, functions should expect two string
Functions intended for authentication will be loaded using `set_auth(function)`, functions should expect two string
arguments, specifically corresponding to username and password, authentication succeed will be evaluated by the return
values `True` in case of success or `False` in case of failure, notice if the function call raises an error it will be
also considered an auth failure.
Expand All @@ -19,17 +19,17 @@ def basic_login(username, password)
return False
end

SetAuth(basic_login)
set_auth(basic_login)
```

## Filtering functions

Function intended to filter incoming, outgoing, listens and accepts can be loaded in drivers using:

- `SetInbound(function)`
- `SetOutbound(function)`
- `SetListen(function)`
- `SetAccept(function)`
- `set_inbound(function)`
- `set_outbound(function)`
- `set_listen(function)`
- `set_accept(function)`

This functions are expected to receive a string value containing the `HOST:PORT` value of the connection. Allowing the
connection will be evaluated by the return values `True` in case of success or `False` in case of failure, notice if the
Expand All @@ -47,8 +47,8 @@ def no_localhost(address)
return True
end

SetInbound(no_localhost)
SetOutbound(no_localhost)
SetListen(no_localhost)
SetAccept(no_localhost)
set_inbound(no_localhost)
set_outbound(no_localhost)
set_listen(no_localhost)
set_accept(no_localhost)
```
Loading

0 comments on commit 091a1a2

Please sign in to comment.