Skip to content

Commit

Permalink
updated to v0.0.4 procspy. added more sample config. re-test now that…
Browse files Browse the repository at this point in the history
… procspy is working
  • Loading branch information
simonmittag committed Jun 10, 2022
1 parent eedb6c3 commit 3aeb439
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
require (
github.com/andybalholm/brotli v1.0.4
github.com/klauspost/compress v1.15.1
github.com/simonmittag/procspy v0.0.3
github.com/simonmittag/procspy v0.0.4
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMT
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/simonmittag/lego/v4 v4.4.1-0.20210801233615-446f36e1d8f3 h1:hdLd+gO0aciLEjk7mVn/4nnhuGhl+9QJM5xnycbQmAI=
github.com/simonmittag/lego/v4 v4.4.1-0.20210801233615-446f36e1d8f3/go.mod h1:KwnaQv/8qFqXREe3f/+7MXWXVzaXpMCIkaaLKxLCgh4=
github.com/simonmittag/procspy v0.0.3 h1:N7pfTmZYTafwtSnRnFMYr5Xib8CMMD9KawMfy7RxVlk=
github.com/simonmittag/procspy v0.0.3/go.mod h1:l0JM9lRYlCWSks6n2bR8LoSXsv4E6a5jUk/tAthhTgg=
github.com/simonmittag/procspy v0.0.4 h1:Y/sXePLWVJUxodCNLtYsMjmUnBcBSZ6BakED0CvkOAw=
github.com/simonmittag/procspy v0.0.4/go.mod h1:l0JM9lRYlCWSks6n2bR8LoSXsv4E6a5jUk/tAthhTgg=
github.com/simonmittag/ws v1.0.42 h1:T/NtSuIDAedeFfGct4P03G0TonoM8TjpLbWhF2GXhy8=
github.com/simonmittag/ws v1.0.42/go.mod h1:qQ22pZZRjR7+hBJ6fCl7YFytZtLWwD75kkmhL1lY/pM=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
Expand Down
2 changes: 1 addition & 1 deletion integration/j8a5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ connection:
downstream:
readTimeoutSeconds: 30
roundTripTimeoutSeconds: 60
idleTimeoutSeconds: 10
idleTimeoutSeconds: 30
http:
port: 8080
maxBodyBytes: 65535
Expand Down
26 changes: 26 additions & 0 deletions integration/j8a6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
connection:
downstream:
readTimeoutSeconds: 30
roundTripTimeoutSeconds: 60
idleTimeoutSeconds: 30
http:
port: 8080
maxBodyBytes: 65535
upstream:
socketTimeoutSeconds: 10
readTimeoutSeconds: 30
idleTimeoutSeconds: 10
maxAttempts: 1
tlsInsecureSkipVerify: true

routes:
- path: /mse6/
resource: mse6

resources:
mse6:
- url:
scheme: http://
host: "[::1]"
port: 60083
18 changes: 9 additions & 9 deletions stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,20 @@ func (rt *Runtime) CountUpConns(proc *process.Process, cs procspy.ConnIter, ips
d := 0
UpConn:
for c := cs.Next(); c != nil; c = cs.Next() {
//if c.PID == uint(proc.Pid) {
for _, v := range rt.Config.Resources {
for _, r := range v {
if c.RemotePort == r.URL.Port {
for _, ip := range ips[r.URL.Host] {
if ip.Equal(c.RemoteAddress) {
d++
continue UpConn
if c.PID == uint(proc.Pid) {
for _, v := range rt.Config.Resources {
for _, r := range v {
if c.RemotePort == r.URL.Port {
for _, ip := range ips[r.URL.Host] {
if ip.Equal(c.RemoteAddress) {
d++
continue UpConn
}
}
}
}
}
}
//}
}
return d
}
Expand Down

0 comments on commit 3aeb439

Please sign in to comment.