Tarun Koyalwar 8a2ff17ad8
allow specifying self-contained at http request level (#4812)
* 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
2024-03-01 16:38:56 +05:30

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)
}