Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gost
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
gost
Commits
c3072d4e
Commit
c3072d4e
authored
Oct 08, 2016
by
rui.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the additional HTTP2 proxies are considered as HTTPS proxies
parent
124bfc42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
README.md
README.md
+1
-1
chain.go
chain.go
+3
-0
conn.go
conn.go
+2
-2
node.go
node.go
+5
-0
No files found.
README.md
View file @
c3072d4e
...
...
@@ -147,7 +147,7 @@ gost的HTTP2支持两种模式并自适应:
*
作为标准的HTTP2代理,并向下兼容HTTPS代理。
*
作为transport(类似于wss),传输其他协议。
**注:gost的代理链仅支持一个HTTP2代理节点,采用就近原则,会将第一个遇到的HTTP2代理节点视为HTTP2代理,其他HTTP2代理节点则被视为HTTP代理。**
**注:gost的代理链仅支持一个HTTP2代理节点,采用就近原则,会将第一个遇到的HTTP2代理节点视为HTTP2代理,其他HTTP2代理节点则被视为HTTP
S
代理。**
加密机制
------
...
...
chain.go
View file @
c3072d4e
...
...
@@ -140,6 +140,9 @@ func (c *ProxyChain) GetConn() (net.Conn, error) {
return
nil
,
err
}
http2Node
:=
c
.
nodes
[
c
.
http2NodeIndex
]
if
http2Node
.
Transport
==
"http2"
{
http2Node
.
Transport
=
"h2"
}
if
http2Node
.
Protocol
==
"http2"
{
http2Node
.
Protocol
=
"socks5"
// assume it as socks5 protocol, so we can do much more things.
}
...
...
conn.go
View file @
c3072d4e
...
...
@@ -73,14 +73,14 @@ func (c *ProxyConn) handshake() error {
return
err
}
c
.
conn
=
conn
case
"tls"
:
// tls connection
case
"tls"
,
"http2"
:
// tls connection
tlsUsed
=
true
cfg
:=
&
tls
.
Config
{
InsecureSkipVerify
:
c
.
Node
.
insecureSkipVerify
(),
ServerName
:
c
.
Node
.
serverName
,
}
c
.
conn
=
tls
.
Client
(
c
.
conn
,
cfg
)
case
"h
ttp2"
:
case
"h
2"
:
// same as http2, but just set a flag for later using.
tlsUsed
=
true
default
:
}
...
...
node.go
View file @
c3072d4e
package
gost
import
(
"fmt"
"net"
"net/url"
"strconv"
...
...
@@ -112,3 +113,7 @@ func (node *ProxyNode) keyFile() string {
}
return
DefaultKeyFile
}
func
(
node
ProxyNode
)
String
()
string
{
return
fmt
.
Sprintf
(
"transport: %s, protocol: %s, addr: %s"
,
node
.
Transport
,
node
.
Protocol
,
node
.
Addr
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment