Commit c7ffa85d authored by wang's avatar wang

111

parent fe042eeb
...@@ -13,6 +13,7 @@ require ( ...@@ -13,6 +13,7 @@ require (
require ( require (
github.com/BurntSushi/toml v1.2.1 // indirect github.com/BurntSushi/toml v1.2.1 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect github.com/andybalholm/brotli v1.0.6 // indirect
github.com/bitly/go-simplejson v0.5.1 // indirect
github.com/bogdanfinn/fhttp v0.5.24 // indirect github.com/bogdanfinn/fhttp v0.5.24 // indirect
github.com/bogdanfinn/utls v1.5.16 // indirect github.com/bogdanfinn/utls v1.5.16 // indirect
github.com/bytedance/sonic v1.8.0 // indirect github.com/bytedance/sonic v1.8.0 // indirect
...@@ -42,13 +43,15 @@ require ( ...@@ -42,13 +43,15 @@ require (
github.com/quic-go/qpack v0.4.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.4.1 // indirect github.com/quic-go/qtls-go1-20 v0.4.1 // indirect
github.com/quic-go/quic-go v0.40.1 // indirect github.com/quic-go/quic-go v0.40.1 // indirect
github.com/refraction-networking/utls v1.5.4 // indirect github.com/refraction-networking/utls v1.6.0 // indirect
github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5 // indirect github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.9 // indirect github.com/ugorji/go/codec v1.2.9 // indirect
github.com/wangluozhe/chttp v0.0.4 // indirect
github.com/wangluozhe/requests v1.2.2 // indirect
go.uber.org/mock v0.3.0 // indirect go.uber.org/mock v0.3.0 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.16.0 // indirect golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect
golang.org/x/mod v0.14.0 // indirect golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect golang.org/x/net v0.19.0 // indirect
......
...@@ -8,6 +8,8 @@ github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sx ...@@ -8,6 +8,8 @@ github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sx
github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ= github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ=
github.com/antonfisher/nested-logrus-formatter v1.3.1/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= github.com/antonfisher/nested-logrus-formatter v1.3.1/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA=
github.com/bitly/go-simplejson v0.5.1 h1:xgwPbetQScXt1gh9BmoJ6j9JMr3TElvuIyjR8pgdoow=
github.com/bitly/go-simplejson v0.5.1/go.mod h1:YOPVLzCfwK14b4Sff3oP1AmGhI9T9Vsg84etUnlyp+Q=
github.com/bogdanfinn/fhttp v0.5.22 h1:U1jhZRtuaOanWWcm1WdMFnwMvSxUQgvO6berqAVTc5o= github.com/bogdanfinn/fhttp v0.5.22 h1:U1jhZRtuaOanWWcm1WdMFnwMvSxUQgvO6berqAVTc5o=
github.com/bogdanfinn/fhttp v0.5.22/go.mod h1:brqi5woc5eSCVHdKYBV8aZLbO7HGqpwyDLeXW+fT18I= github.com/bogdanfinn/fhttp v0.5.22/go.mod h1:brqi5woc5eSCVHdKYBV8aZLbO7HGqpwyDLeXW+fT18I=
github.com/bogdanfinn/fhttp v0.5.24 h1:OlyBKjvJp6a3TotN3wuj4mQHHRbfK7QUMrzCPOZGhRc= github.com/bogdanfinn/fhttp v0.5.24 h1:OlyBKjvJp6a3TotN3wuj4mQHHRbfK7QUMrzCPOZGhRc=
...@@ -102,6 +104,8 @@ github.com/quic-go/quic-go v0.40.1 h1:X3AGzUNFs0jVuO3esAGnTfvdgvL4fq655WaOi1snv1 ...@@ -102,6 +104,8 @@ github.com/quic-go/quic-go v0.40.1 h1:X3AGzUNFs0jVuO3esAGnTfvdgvL4fq655WaOi1snv1
github.com/quic-go/quic-go v0.40.1/go.mod h1:PeN7kuVJ4xZbxSv/4OX6S1USOX8MJvydwpTx31vx60c= github.com/quic-go/quic-go v0.40.1/go.mod h1:PeN7kuVJ4xZbxSv/4OX6S1USOX8MJvydwpTx31vx60c=
github.com/refraction-networking/utls v1.5.4 h1:9k6EO2b8TaOGsQ7Pl7p9w6PUhx18/ZCeT0WNTZ7Uw4o= github.com/refraction-networking/utls v1.5.4 h1:9k6EO2b8TaOGsQ7Pl7p9w6PUhx18/ZCeT0WNTZ7Uw4o=
github.com/refraction-networking/utls v1.5.4/go.mod h1:SPuDbBmgLGp8s+HLNc83FuavwZCFoMmExj+ltUHiHUw= github.com/refraction-networking/utls v1.5.4/go.mod h1:SPuDbBmgLGp8s+HLNc83FuavwZCFoMmExj+ltUHiHUw=
github.com/refraction-networking/utls v1.6.0 h1:X5vQMqVx7dY7ehxxqkFER/W6DSjy8TMqSItXm8hRDYQ=
github.com/refraction-networking/utls v1.6.0/go.mod h1:kHJ6R9DFFA0WsRgBM35iiDku4O7AqPR6y79iuzW7b10=
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
...@@ -121,6 +125,10 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS ...@@ -121,6 +125,10 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU=
github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/wangluozhe/chttp v0.0.4 h1:6qpxXGPG+DjPM5JDZTKteIQinZvDn6XslsrDu/cxxIA=
github.com/wangluozhe/chttp v0.0.4/go.mod h1:a89dXbcRV/36MT66nkqzOJXejTBpYfYJvQ3Fw8Z4+HY=
github.com/wangluozhe/requests v1.2.2 h1:p2bQ9qrOSKvXK4GhImkG+f/heieUJtQ86pFhwfz3Q48=
github.com/wangluozhe/requests v1.2.2/go.mod h1:uxRiqW1jQ+6teXMziwT7Rx0WFFG2SW5prxHxp+ga9nE=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
...@@ -136,6 +144,8 @@ golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= ...@@ -136,6 +144,8 @@ golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8=
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
......
...@@ -2,11 +2,10 @@ package main ...@@ -2,11 +2,10 @@ package main
import ( import (
"fmt" "fmt"
"github.com/bogdanfinn/fhttp/http2" http "github.com/wangluozhe/chttp"
tls_client "github.com/bogdanfinn/tls-client" "github.com/wangluozhe/requests"
"github.com/bogdanfinn/tls-client/profiles" "github.com/wangluozhe/requests/transport"
tls "github.com/bogdanfinn/utls" "github.com/wangluozhe/requests/url"
"io"
) )
// var Chrome_117 = profiles.ClientProfile{ // var Chrome_117 = profiles.ClientProfile{
...@@ -17,137 +16,253 @@ import ( ...@@ -17,137 +16,253 @@ import (
// connectionFlow: 15663105, // connectionFlow: 15663105,
// } // }
func main() { func main() {
clientHello := tls.ClientHelloID{ u := url.NewRequest()
Client: "Chrome", headers := &http.Header{
RandomExtensionOrder: false, "User-Agent": []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/112.0"},
Version: "117", "accept": []string{"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"},
Seed: nil, "accept-language": []string{"zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"},
SpecFactory: func() (tls.ClientHelloSpec, error) { "accept-encoding": []string{"gzip, deflate, br"},
return tls.ClientHelloSpec{ "upgrade-insecure-requests": []string{"1"},
CipherSuites: []uint16{ "sec-fetch-dest": []string{"document"},
tls.GREASE_PLACEHOLDER, "sec-fetch-mode": []string{"navigate"},
tls.TLS_AES_128_GCM_SHA256, "sec-fetch-site": []string{"none"},
tls.TLS_AES_256_GCM_SHA384, "sec-fetch-user": []string{"?1"},
tls.TLS_CHACHA20_POLY1305_SHA256, "te": []string{"trailers"},
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, http.PHeaderOrderKey: []string{
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
},
CompressionMethods: []uint8{
tls.CompressionNone,
},
Extensions: []tls.TLSExtension{
&tls.UtlsGREASEExtension{},
&tls.SNIExtension{},
&tls.StatusRequestExtension{}, // 5
&tls.SupportedCurvesExtension{[]tls.CurveID{ // 10
tls.CurveID(tls.GREASE_PLACEHOLDER),
tls.X25519,
tls.CurveP256,
tls.CurveP384,
}},
&tls.SupportedPointsExtension{SupportedPoints: []byte{ // 11
tls.PointFormatUncompressed,
}},
&tls.ALPNExtension{AlpnProtocols: []string{"h2", "http/1.1"}}, // 16
&tls.StatusRequestV2Extension{}, //17
&tls.UtlsExtendedMasterSecretExtension{}, //23
&tls.SessionTicketExtension{}, //35
&tls.SignatureAlgorithmsExtension{SupportedSignatureAlgorithms: []tls.SignatureScheme{ //13
tls.ECDSAWithP256AndSHA256,
tls.PSSWithSHA256,
tls.PKCS1WithSHA256,
tls.ECDSAWithP384AndSHA384,
tls.PSSWithSHA384,
tls.PKCS1WithSHA384,
tls.PSSWithSHA512,
tls.PKCS1WithSHA512,
}},
&tls.SupportedVersionsExtension{[]uint16{ //43
tls.GREASE_PLACEHOLDER,
tls.VersionTLS13,
tls.VersionTLS12,
}},
&tls.PSKKeyExchangeModesExtension{[]uint8{ // 45
tls.PskModeDHE,
}},
&tls.SignatureAlgorithmsCertExtension{SupportedSignatureAlgorithms: []tls.SignatureScheme{tls.PKCS1WithSHA256}}, // 50
&tls.KeyShareExtension{[]tls.KeyShare{ //51
{Group: tls.CurveID(tls.GREASE_PLACEHOLDER), Data: []byte{0}},
{Group: tls.X25519},
}},
&tls.RenegotiationInfoExtension{Renegotiation: tls.RenegotiateOnceAsClient}, // 65281
//&tls.PreSharedKeyExtension{},
//
//&tls.ALPSExtension{SupportedProtocols: []string{"h2"}}, // 17513
//
//&tls.UtlsCompressCertExtension{[]tls.CertCompressionAlgo{ //27
// tls.CertCompressionBrotli,
//}},
//&tls.SCTExtension{}, // 18
//
//&tls.UtlsGREASEExtension{},
//&tls.UtlsPaddingExtension{GetPaddingLen: tls.BoringPaddingStyle}, // 21
},
}, nil
},
}
h2Settings := map[http2.SettingID]uint32{
http2.SettingHeaderTableSize: 65536,
http2.SettingEnablePush: 0,
http2.SettingInitialWindowSize: 6291456,
http2.SettingMaxHeaderListSize: 262144,
}
h2SettingIds := []http2.SettingID{
http2.SettingHeaderTableSize,
http2.SettingEnablePush,
http2.SettingInitialWindowSize,
http2.SettingMaxHeaderListSize,
}
h2Order := []string{
":method", ":method",
":path",
":authority", ":authority",
":scheme", ":scheme",
":path", },
} http.HeaderOrderKey: []string{
"user-agent",
Chrome := profiles.NewClientProfile(clientHello, h2Settings, h2SettingIds, h2Order, 15663105, nil, nil) "accept",
url := "https://tls.peet.ws/api/all" "accept-language",
jar := tls_client.NewCookieJar() "accept-encoding",
options := []tls_client.HttpClientOption{ "upgrade-insecure-requests",
tls_client.WithClientProfile(Chrome), "sec-fetch-dest",
//tls_client.WithForceHttp1(), "sec-fetch-mode",
tls_client.WithCookieJar(jar), "sec-fetch-site",
//tls_client.WithRandomTLSExtensionOrder(), "sec-fetch-user",
//tls_client.WithProxyUrl("http://user:pass@host:port"), "te",
tls_client.WithInsecureSkipVerify(), },
}
logger := tls_client.NewNoopLogger()
client, err := tls_client.NewHttpClient(logger, options...)
if err != nil {
panic(client)
} }
get, err := client.Get(url) u.Headers = headers
if err != nil { u.Ja3 = "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-21,29-23-24,0"
return h2s := &transport.H2Settings{
Settings: map[string]int{
"HEADER_TABLE_SIZE": 65536,
"ENABLE_PUSH": 0,
"MAX_HEADER_LIST_SIZE": 262144,
"MAX_CONCURRENT_STREAMS": 1000,
"INITIAL_WINDOW_SIZE": 131072,
"MAX_FRAME_SIZE": 16384,
},
SettingsOrder: []string{
"HEADER_TABLE_SIZE",
"INITIAL_WINDOW_SIZE",
"MAX_FRAME_SIZE",
},
ConnectionFlow: 12517377,
HeaderPriority: map[string]interface{}{
"weight": 42,
"streamDep": 13,
"exclusive": false,
},
PriorityFrames: []map[string]interface{}{
{
"streamID": 3,
"priorityParam": map[string]interface{}{
"weight": 201,
"streamDep": 0,
"exclusive": false,
},
},
{
"streamID": 5,
"priorityParam": map[string]interface{}{
"weight": 101,
"streamDep": 0,
"exclusive": false,
},
},
{
"streamID": 7,
"priorityParam": map[string]interface{}{
"weight": 1,
"streamDep": 0,
"exclusive": false,
},
},
{
"streamID": 9,
"priorityParam": map[string]interface{}{
"weight": 1,
"streamDep": 7,
"exclusive": false,
},
},
{
"streamID": 11,
"priorityParam": map[string]interface{}{
"weight": 1,
"streamDep": 3,
"exclusive": false,
},
},
{
"streamID": 13,
"priorityParam": map[string]interface{}{
"weight": 241,
"streamDep": 0,
"exclusive": false,
},
},
},
} }
defer get.Body.Close() h2ss := transport.ToHTTP2Settings(h2s)
all, err := io.ReadAll(get.Body) u.HTTP2Settings = h2ss
u.ForceHTTP1 = true
u.Body = "{\"SearchTypeSelection\":1,\"SortType\":\"bestmatches\",\"SortTypeDescending\":false,\"Trips\":[{\"Origin\":\"HNL\",\"Destination\":\"LAX\",\"DepartDate\":\"2024-01-28\",\"Index\":1,\"TripIndex\":1,\"SearchRadiusMilesOrigin\":0,\"SearchRadiusMilesDestination\":0,\"DepartTimeApprox\":0,\"SearchFiltersIn\":{\"FareFamily\":\"ECONOMY\",\"AirportsStop\":null,\"AirportsStopToAvoid\":null,\"StopCountMax\":null,\"StopCountMin\":1},\"UseFilters\":true,\"NonStopMarket\":true}],\"CabinPreferenceMain\":\"economy\",\"PaxInfoList\":[{\"PaxType\":1},{\"PaxType\":1},{\"PaxType\":1},{\"PaxType\":1},{\"PaxType\":1},{\"PaxType\":1}],\"AwardTravel\":false,\"NGRP\":false,\"CalendarLengthOfStay\":0,\"PetCount\":0,\"RecentSearchKey\":\"HNLLAX1/28/2024\",\"CalendarFilters\":{\"Filters\":{\"PriceScheduleOptions\":{\"Stops\":1}}},\"Characteristics\":[{\"Code\":\"SOFT_LOGGED_IN\",\"Value\":false},{\"Code\":\"UsePassedCartId\",\"Value\":false}],\"FareType\":\"Refundable\",\"CartId\":\"2D54590B-E6C7-4D3B-A5F6-17AD30F17FDA\"}"
u.Proxies = "http://127.0.0.1:8890"
post, err := requests.Post("https://www.united.com/api/flight/FetchFlights", u)
if err != nil { if err != nil {
panic(err)
return return
} }
fmt.Print(string(all)) fmt.Print(post.Text)
//clientHello := tls.ClientHelloID{
// Client: "Chrome",
// RandomExtensionOrder: false,
// Version: "117",
// Seed: nil,
// SpecFactory: func() (tls.ClientHelloSpec, error) {
// return tls.ClientHelloSpec{
// CipherSuites: []uint16{
// tls.GREASE_PLACEHOLDER,
// tls.TLS_AES_128_GCM_SHA256,
// tls.TLS_AES_256_GCM_SHA384,
// tls.TLS_CHACHA20_POLY1305_SHA256,
// tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
// tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
// tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
// tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
// tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
// tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
// tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
// tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
// tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
// tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
// tls.TLS_RSA_WITH_AES_128_CBC_SHA,
// tls.TLS_RSA_WITH_AES_256_CBC_SHA,
// },
// CompressionMethods: []uint8{
// tls.CompressionNone,
// },
// Extensions: []tls.TLSExtension{
// &tls.UtlsGREASEExtension{},
//
// &tls.SNIExtension{},
// &tls.StatusRequestExtension{}, // 5
// &tls.SupportedCurvesExtension{[]tls.CurveID{ // 10
// tls.CurveID(tls.GREASE_PLACEHOLDER),
// tls.X25519,
// tls.CurveP256,
// tls.CurveP384,
// }},
// &tls.SupportedPointsExtension{SupportedPoints: []byte{ // 11
// tls.PointFormatUncompressed,
// }},
// &tls.ALPNExtension{AlpnProtocols: []string{"h2", "http/1.1"}}, // 16
// &tls.StatusRequestV2Extension{}, //17
//
// &tls.UtlsExtendedMasterSecretExtension{}, //23
// &tls.SessionTicketExtension{}, //35
//
// &tls.SignatureAlgorithmsExtension{SupportedSignatureAlgorithms: []tls.SignatureScheme{ //13
// tls.ECDSAWithP256AndSHA256,
// tls.PSSWithSHA256,
// tls.PKCS1WithSHA256,
// tls.ECDSAWithP384AndSHA384,
// tls.PSSWithSHA384,
// tls.PKCS1WithSHA384,
// tls.PSSWithSHA512,
// tls.PKCS1WithSHA512,
// }},
// &tls.SupportedVersionsExtension{[]uint16{ //43
// tls.GREASE_PLACEHOLDER,
// tls.VersionTLS13,
// tls.VersionTLS12,
// }},
// &tls.PSKKeyExchangeModesExtension{[]uint8{ // 45
// tls.PskModeDHE,
// }},
// &tls.SignatureAlgorithmsCertExtension{SupportedSignatureAlgorithms: []tls.SignatureScheme{tls.PKCS1WithSHA256}}, // 50
// &tls.KeyShareExtension{[]tls.KeyShare{ //51
// {Group: tls.CurveID(tls.GREASE_PLACEHOLDER), Data: []byte{0}},
// {Group: tls.X25519},
// }},
// &tls.RenegotiationInfoExtension{Renegotiation: tls.RenegotiateOnceAsClient}, // 65281
// //&tls.PreSharedKeyExtension{},
// //
// //&tls.ALPSExtension{SupportedProtocols: []string{"h2"}}, // 17513
// //
// //&tls.UtlsCompressCertExtension{[]tls.CertCompressionAlgo{ //27
// // tls.CertCompressionBrotli,
// //}},
// //&tls.SCTExtension{}, // 18
// //
// //&tls.UtlsGREASEExtension{},
// //&tls.UtlsPaddingExtension{GetPaddingLen: tls.BoringPaddingStyle}, // 21
// },
// }, nil
// },
//}
//h2Settings := map[http2.SettingID]uint32{
// http2.SettingHeaderTableSize: 65536,
// http2.SettingEnablePush: 0,
// http2.SettingInitialWindowSize: 6291456,
// http2.SettingMaxHeaderListSize: 262144,
//}
//h2SettingIds := []http2.SettingID{
// http2.SettingHeaderTableSize,
// http2.SettingEnablePush,
// http2.SettingInitialWindowSize,
// http2.SettingMaxHeaderListSize,
//}
//h2Order := []string{
// ":method",
// ":authority",
// ":scheme",
// ":path",
//}
//
//Chrome := profiles.NewClientProfile(clientHello, h2Settings, h2SettingIds, h2Order, 15663105, nil, nil)
//url := "https://tls.peet.ws/api/all"
//jar := tls_client.NewCookieJar()
//options := []tls_client.HttpClientOption{
// tls_client.WithClientProfile(Chrome),
// //tls_client.WithForceHttp1(),
// tls_client.WithCookieJar(jar),
// //tls_client.WithRandomTLSExtensionOrder(),
// //tls_client.WithProxyUrl("http://user:pass@host:port"),
// tls_client.WithInsecureSkipVerify(),
//}
//
//logger := tls_client.NewNoopLogger()
//client, err := tls_client.NewHttpClient(logger, options...)
//if err != nil {
// panic(client)
//}
//get, err := client.Get(url)
//if err != nil {
// return
//}
//defer get.Body.Close()
//all, err := io.ReadAll(get.Body)
//if err != nil {
// return
//}
//fmt.Print(string(all))
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment