-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix proxy handling issues in Nuclei #6099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Related to projectdiscovery#6029 Address proxy handling issues in Nuclei to respect concurrency settings and improve request speed. * **internal/runner/proxy.go** - Add logic to handle concurrency settings for proxy servers. - Ensure proxy settings respect concurrency values. * **internal/runner/runner.go** - Initialize the HTTP client with proxy settings and ensure concurrency is respected. - Add logic to handle concurrency settings for proxy servers. * **pkg/protocols/http/httpclientpool/clientpool.go** - Manage HTTP client pooling and enforce concurrency settings with proxies. - Ensure proxy settings respect concurrency values.
WalkthroughThis pull request introduces two internal improvements. In the proxy module, the Changes
Suggested reviewers
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
internal/runner/runner.go (1)
879-879
: Fixed variable assignment syntaxThe change from using short variable declaration (
:=
) to standard assignment (=
) is correct ifdata
was previously declared in this scope. This prevents the unintended creation of a new variable in a nested scope.However, consider adding error handling for the JSON marshaling operation instead of ignoring it with
_
.-data, _ = json.MarshalIndent(resumeCfgClone, "", "\t") +data, err := json.MarshalIndent(resumeCfgClone, "", "\t") +if err != nil { + return fmt.Errorf("failed to marshal resume config: %w", err) +}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
internal/runner/proxy.go
(2 hunks)internal/runner/runner.go
(1 hunks)
🔇 Additional comments (1)
internal/runner/proxy.go (1)
66-71
: Good use of atomic operations for thread safetyThe addition of atomic operations to ensure proxy settings respect concurrency values is a good practice. Using
atomic.Int32
provides thread-safe access to the concurrency value in a multi-threaded environment, which is important when dealing with proxy configurations.
Thanks so much for your contribution @Likhithsai2580 , we appreciate it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Likhithsai2580 Thanks for your PR. How this exactly fixes the linked issue? From the code it seems like it's just overwriting options.Concurrency
with itself
Related to #6029
Address proxy handling issues in Nuclei to respect concurrency settings and improve request speed.
internal/runner/proxy.go
internal/runner/runner.go
pkg/protocols/http/httpclientpool/clientpool.go
Summary by CodeRabbit