aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example.go3
-rw-r--r--run_request.go2
-rw-r--r--target.go7
3 files changed, 4 insertions, 8 deletions
diff --git a/example.go b/example.go
index 73c97f3..60bed1c 100644
--- a/example.go
+++ b/example.go
@@ -209,7 +209,7 @@ func (ex *Example) registerTargetHTTP() (err error) {
Name: `Example HTTP`,
Hint: `This section provide an example of HTTP endpoints that can be tested and attacked.`,
BaseURL: fmt.Sprintf(`http://%s`, ex.Gorankusu.Env.ListenAddress),
- Opts: &AttackOptions{
+ Opts: AttackOptions{
Duration: 10 * time.Second,
RatePerSecond: 1,
},
@@ -412,7 +412,6 @@ func (ex *Example) registerTargetWebSocket() (err error) {
Name: `Example WebSocket`,
Hint: `This section provide an example of WebSocket endpoints that can be tested.`,
BaseURL: fmt.Sprintf(`ws://%s`, websocketAddress),
- Opts: &AttackOptions{},
Vars: KeyFormInput{
`WebSocketVar`: FormInput{
Label: `WebSocketVar`,
diff --git a/run_request.go b/run_request.go
index d999ff8..0ddaafc 100644
--- a/run_request.go
+++ b/run_request.go
@@ -14,9 +14,9 @@ import (
type RunRequest struct {
result *AttackResult
- Target Target
WebSocketTarget WebSocketTarget
HTTPTarget HTTPTarget
+ Target Target
}
// generateRunRequest merge the [RunRequest] req from WUI with original
diff --git a/target.go b/target.go
index 6214dfe..13d4571 100644
--- a/target.go
+++ b/target.go
@@ -14,7 +14,6 @@ type Target struct {
// HTTPClient that can be used for running HTTPTarget.
HTTPClient *libhttp.Client `json:"-"`
- Opts *AttackOptions
Vars KeyFormInput
ID string
@@ -29,6 +28,8 @@ type Target struct {
HTTPTargets []*HTTPTarget
WebSocketTargets []*WebSocketTarget
+
+ Opts AttackOptions
}
func (target *Target) init() (err error) {
@@ -41,10 +42,6 @@ func (target *Target) init() (err error) {
target.ID = generateID(target.Name)
- if target.Opts == nil {
- target.Opts = &AttackOptions{}
- }
-
target.Opts.init()
if target.Vars == nil {