mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 17:05:29 +00:00
* allow specifying self-contained at requestlevel * fix IsSMTP js example * update smtp + fix examples * update smtp error message * add code reference in js protocol * update js docs * remove debug stmt
33 lines
690 B
Go
33 lines
690 B
Go
package smtp
|
|
|
|
import (
|
|
lib_smtp "github.com/projectdiscovery/nuclei/v3/pkg/js/libs/smtp"
|
|
|
|
"github.com/dop251/goja"
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/js/gojs"
|
|
)
|
|
|
|
var (
|
|
module = gojs.NewGojaModule("nuclei/smtp")
|
|
)
|
|
|
|
func init() {
|
|
module.Set(
|
|
gojs.Objects{
|
|
// Functions
|
|
"NewSMTPClient": lib_smtp.NewSMTPClient,
|
|
|
|
// Var and consts
|
|
|
|
// Objects / Classes
|
|
"Client": lib_smtp.NewSMTPClient,
|
|
"SMTPMessage": gojs.GetClassConstructor[lib_smtp.SMTPMessage](&lib_smtp.SMTPMessage{}),
|
|
"SMTPResponse": gojs.GetClassConstructor[lib_smtp.SMTPResponse](&lib_smtp.SMTPResponse{}),
|
|
},
|
|
).Register()
|
|
}
|
|
|
|
func Enable(runtime *goja.Runtime) {
|
|
module.Enable(runtime)
|
|
}
|