Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
55a91868
Commit
55a91868
authored
Mar 08, 2018
by
AlexStocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change remark
parent
b07130c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
16 deletions
+11
-16
client.go
client.go
+1
-5
server.go
server.go
+9
-10
version.go
version.go
+1
-1
No files found.
client.go
View file @
55a91868
...
...
@@ -146,11 +146,7 @@ func NewWSClient(connNum int, connInterval time.Duration, serverAddr string) *Cl
// @cert is client certificate file. it can be emtpy.
// @privateKey is client private key(contains its public key). it can be empty.
// @caCert is the root certificate file to verify the legitimacy of server
func
NewWSSClient
(
connNum
int
,
connInterval
time
.
Duration
,
serverAddr
string
,
cert
string
)
*
Client
{
func
NewWSSClient
(
connNum
int
,
connInterval
time
.
Duration
,
serverAddr
string
,
cert
string
)
*
Client
{
if
connNum
<=
0
{
connNum
=
1
...
...
server.go
View file @
55a91868
...
...
@@ -62,6 +62,7 @@ type Server struct {
}
// NewTCServer builds a tcp server.
// @addr server listen address.
func
NewTCPServer
(
addr
string
)
*
Server
{
return
&
Server
{
typ
:
TCP_SERVER
,
...
...
@@ -71,7 +72,7 @@ func NewTCPServer(addr string) *Server {
}
// NewUDPServer builds a unconnected udp server.
// @
path: websocket request url path
// @
addr server listen address.
func
NewUDPPServer
(
addr
string
)
*
Server
{
return
&
Server
{
typ
:
UDP_SERVER
,
...
...
@@ -80,31 +81,29 @@ func NewUDPPServer(addr string) *Server {
}
}
// NewWSSServer builds a websocket server.
// NewWSServer builds a websocket server.
// @addr server listen address.
// @path: websocket request url path
func
NewWSServer
(
path
string
)
*
Server
{
func
NewWSServer
(
addr
string
,
path
string
)
*
Server
{
return
&
Server
{
typ
:
WS_SERVER
,
done
:
make
(
chan
gxsync
.
Empty
),
addr
:
addr
,
path
:
path
,
}
}
// NewWSSServer builds a secure websocket server.
// @addr server listen address.
// @path: websocket request url path
// @cert: server certificate file
// @privateKey: server private key(contains its public key)
// @caCert: root certificate file. to verify the legitimacy of client. it can be nil.
func
NewWSSServer
(
path
string
,
cert
string
,
privateKey
string
,
caCert
string
,
)
*
Server
{
func
NewWSSServer
(
addr
,
path
,
cert
,
privateKey
,
caCert
string
)
*
Server
{
return
&
Server
{
typ
:
WSS_SERVER
,
done
:
make
(
chan
gxsync
.
Empty
),
addr
:
addr
,
path
:
path
,
cert
:
cert
,
privateKey
:
privateKey
,
...
...
version.go
View file @
55a91868
...
...
@@ -10,7 +10,7 @@
package
getty
const
(
Version
=
"0.8.
0
1"
Version
=
"0.8.1"
DATE
=
"2018/03/08"
GETTY_MAJOR
=
0
GETTY_MINOR
=
8
...
...
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