Skip to content

Commit

Permalink
fix http transport
Browse files Browse the repository at this point in the history
  • Loading branch information
theblackturtle committed Feb 11, 2020
1 parent 24349d4 commit 16d8aa9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions core/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ func NewCrawler(site *url.URL, cmd *cobra.Command) *Crawler {
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 0,
IdleConnTimeout: 5 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 5 * time.Second,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}

timeout, _ := cmd.Flags().GetInt("timeout")
Expand Down
3 changes: 3 additions & 0 deletions core/robots.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func ParseRobots(site *url.URL, output *Output, c *colly.Collector, wg *sync.Wai
if strings.Contains(line, "llow: ") {
url := re.ReplaceAllString(line, "")
url = FixUrl(url, site)
if url == "" {
continue
}
outputFormat := fmt.Sprintf("[robots] - %s", url)
fmt.Println(outputFormat)
if output != nil {
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ github.com/gocolly/colly/v2 v2.0.1/go.mod h1:ePrRZlJcLTU2C/f8pJzXfkdBtBDHL5hOaKL
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg=
github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=
github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
Expand Down

0 comments on commit 16d8aa9

Please sign in to comment.