mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 03:35:27 +00:00
* use parsed options while signing * update project layout to v3 * fix .gitignore * remove example template * misc updates * bump tlsx version * hide template sig warning with env * js: retain value while using log * fix nil pointer derefernce * misc doc update --------- Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
35 lines
996 B
Go
35 lines
996 B
Go
package networkclientpool
|
|
|
|
import (
|
|
"github.com/projectdiscovery/fastdialer/fastdialer"
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/types"
|
|
)
|
|
|
|
var (
|
|
normalClient *fastdialer.Dialer
|
|
)
|
|
|
|
// Init initializes the clientpool implementation
|
|
func Init(options *types.Options /*TODO review unused parameter*/) error {
|
|
// Don't create clients if already created in the past.
|
|
if normalClient != nil {
|
|
return nil
|
|
}
|
|
normalClient = protocolstate.Dialer
|
|
return nil
|
|
}
|
|
|
|
// Configuration contains the custom configuration options for a client
|
|
type Configuration struct{}
|
|
|
|
// Hash returns the hash of the configuration to allow client pooling
|
|
func (c *Configuration) Hash() string {
|
|
return ""
|
|
}
|
|
|
|
// Get creates or gets a client for the protocol based on custom configuration
|
|
func Get(options *types.Options, configuration *Configuration /*TODO review unused parameters*/) (*fastdialer.Dialer, error) {
|
|
return normalClient, nil
|
|
}
|