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
be14152e
Commit
be14152e
authored
Mar 24, 2017
by
ginuerzh
Committed by
GitHub
Mar 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.4' into certificates
parents
6fe6bf7e
561b4b10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
cmd/gost/.gitignore
cmd/gost/.gitignore
+1
-0
cmd/gost/main.go
cmd/gost/main.go
+0
-11
server.go
server.go
+19
-9
No files found.
cmd/gost/.gitignore
0 → 100644
View file @
be14152e
gost
cmd/gost/main.go
View file @
be14152e
...
@@ -68,17 +68,6 @@ func main() {
...
@@ -68,17 +68,6 @@ func main() {
wg
.
Add
(
1
)
wg
.
Add
(
1
)
go
func
(
node
gost
.
ProxyNode
)
{
go
func
(
node
gost
.
ProxyNode
)
{
defer
wg
.
Done
()
defer
wg
.
Done
()
certFile
,
keyFile
:=
node
.
Get
(
"cert"
),
node
.
Get
(
"key"
)
if
certFile
==
""
{
certFile
=
gost
.
DefaultCertFile
}
if
keyFile
==
""
{
keyFile
=
gost
.
DefaultKeyFile
}
cert
,
err
:=
gost
.
LoadCertificate
(
certFile
,
keyFile
)
if
err
!=
nil
{
glog
.
Fatal
(
err
)
}
server
:=
gost
.
NewProxyServer
(
node
,
chain
)
server
:=
gost
.
NewProxyServer
(
node
,
chain
)
glog
.
Fatal
(
server
.
Serve
())
glog
.
Fatal
(
server
.
Serve
())
}(
serverNode
)
}(
serverNode
)
...
...
server.go
View file @
be14152e
...
@@ -3,17 +3,18 @@ package gost
...
@@ -3,17 +3,18 @@ package gost
import
(
import
(
"bufio"
"bufio"
"crypto/tls"
"crypto/tls"
"github.com/ginuerzh/gosocks4"
"github.com/ginuerzh/gosocks5"
"github.com/golang/glog"
ss
"github.com/shadowsocks/shadowsocks-go/shadowsocks"
"golang.org/x/crypto/ssh"
"io"
"io"
"io/ioutil"
"io/ioutil"
"net"
"net"
"net/http"
"net/http"
"strconv"
"strconv"
"strings"
"strings"
"github.com/ginuerzh/gosocks4"
"github.com/ginuerzh/gosocks5"
"github.com/golang/glog"
ss
"github.com/shadowsocks/shadowsocks-go/shadowsocks"
"golang.org/x/crypto/ssh"
)
)
type
ProxyServer
struct
{
type
ProxyServer
struct
{
...
@@ -25,13 +26,22 @@ type ProxyServer struct {
...
@@ -25,13 +26,22 @@ type ProxyServer struct {
ota
bool
ota
bool
}
}
func
NewProxyServer
(
node
ProxyNode
,
chain
*
ProxyChain
,
config
*
tls
.
Config
)
*
ProxyServer
{
func
NewProxyServer
(
node
ProxyNode
,
chain
*
ProxyChain
)
*
ProxyServer
{
certFile
,
keyFile
:=
node
.
certFile
(),
node
.
keyFile
()
cert
,
err
:=
LoadCertificate
(
certFile
,
keyFile
)
if
err
!=
nil
{
glog
.
Fatal
(
err
)
}
config
:=
&
tls
.
Config
{
Certificates
:
[]
tls
.
Certificate
{
cert
},
}
if
chain
==
nil
{
if
chain
==
nil
{
chain
=
NewProxyChain
()
chain
=
NewProxyChain
()
}
}
if
config
==
nil
{
config
=
&
tls
.
Config
{}
}
var
cipher
*
ss
.
Cipher
var
cipher
*
ss
.
Cipher
var
ota
bool
var
ota
bool
...
...
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