Skip to content

Commit

Permalink
add:customize tls transport layer
Browse files Browse the repository at this point in the history
  • Loading branch information
iarsham committed Aug 29, 2024
1 parent 3273553 commit 9d9b80c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions transport.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package scrapify

import (
"crypto/tls"
"net/http"
)

func NewTransport(browser Browser, debug bool) http.RoundTripper {
tlsConfig := &tls.Config{
MinVersion: tls.VersionTLS12,
MaxVersion: tls.VersionTLS13,
CipherSuites: MapBrowserToCipher[browser],
InsecureSkipVerify: debug,
}
return &http.Transport{
TLSClientConfig: tlsConfig,
}
}

0 comments on commit 9d9b80c

Please sign in to comment.