2021-01-12 02:27:32 +05:30
|
|
|
package protocolinit
|
|
|
|
|
|
|
|
|
|
import (
|
2024-01-18 04:39:15 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/js/compiler"
|
2023-10-17 17:44:13 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/dns/dnsclientpool"
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/http/httpclientpool"
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/http/signerpool"
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/network/networkclientpool"
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/whois/rdapclientpool"
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/types"
|
2024-11-27 17:36:26 +03:00
|
|
|
_ "github.com/projectdiscovery/utils/global"
|
2021-01-12 02:27:32 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Init initializes the client pools for the protocols
|
|
|
|
|
func Init(options *types.Options) error {
|
2021-04-18 11:57:43 +02:00
|
|
|
if err := protocolstate.Init(options); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2021-01-12 02:27:32 +05:30
|
|
|
if err := dnsclientpool.Init(options); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if err := httpclientpool.Init(options); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2021-11-26 13:49:12 +01:00
|
|
|
if err := signerpool.Init(options); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2022-11-08 12:57:18 +01:00
|
|
|
if err := networkclientpool.Init(options); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if err := rdapclientpool.Init(options); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2024-01-18 04:39:15 +05:30
|
|
|
if err := compiler.Init(options); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2022-11-08 12:57:18 +01:00
|
|
|
return nil
|
2021-01-12 02:27:32 +05:30
|
|
|
}
|
2021-04-01 01:35:32 +05:30
|
|
|
|
2025-07-09 14:47:26 -05:00
|
|
|
func Close(executionId string) {
|
|
|
|
|
protocolstate.Close(executionId)
|
2021-04-18 11:57:43 +02:00
|
|
|
}
|