MCPcopy Create free account
hub / github.com/chainreactors/spray / Run

Method Run

core/task.go:42–69  ·  view source on GitHub ↗
(baseurl string)

Source from the content-addressed store, hash-verified

40}
41
42func (gen *TaskGenerator) Run(baseurl string) {
43 parsed, err := url.Parse(baseurl)
44 if err != nil {
45 logs.Log.Warnf("parse %s, %s ", baseurl, err.Error())
46 return
47 }
48
49 if parsed.Scheme == "" {
50 if parsed.Port() == "443" {
51 parsed.Scheme = "https"
52 } else {
53 parsed.Scheme = "http"
54 }
55 }
56
57 if len(gen.ports) == 0 {
58 gen.In <- &Task{baseUrl: parsed.String()}
59 return
60 }
61
62 for _, p := range gen.ports {
63 if parsed.Host == "" {
64 gen.In <- &Task{baseUrl: fmt.Sprintf("%s://%s:%s", parsed.Scheme, parsed.Path, p)}
65 } else {
66 gen.In <- &Task{baseUrl: fmt.Sprintf("%s://%s:%s/%s", parsed.Scheme, parsed.Host, p, parsed.Path)}
67 }
68 }
69}
70
71func (gen *TaskGenerator) Close() {
72 close(gen.tasks)

Callers 9

BuildTasksMethod · 0.95
TestE2E_CIDR_1000WordsFunction · 0.45
BuildWordsMethod · 0.45
TestParseRawResponseFunction · 0.45
CompareWithExprFunction · 0.45
LoadWordlistFunction · 0.45
TestProtonTagMappingFunction · 0.45
TestProtonCategoryTagsFunction · 0.45
TestIsProtonExtractorFunction · 0.45

Calls 2

ErrorMethod · 0.80
StringMethod · 0.45

Tested by 5

TestE2E_CIDR_1000WordsFunction · 0.36
TestParseRawResponseFunction · 0.36
TestProtonTagMappingFunction · 0.36
TestProtonCategoryTagsFunction · 0.36
TestIsProtonExtractorFunction · 0.36