Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

Commit

Permalink
v0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lzjluzijie committed Apr 30, 2018
2 parents 5ec6fb0 + 7c082bd commit d60277a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 16 deletions.
26 changes: 18 additions & 8 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@

缺点就是刚刚开始开发,没有GUI客户端,功能也比较少,如果你能来帮我那就太好了!

### 示例 (开启 TLS)
## 示例

#### 服务端
### Caddy TLS

#### 服务端
```
go get -v github.com/lzjluzijie/websocks/cmd/websocks-server
websocks-server -l :2333 -p /password
./websocks server -l :2333 -p /password
```

#### 客户端

```
go get -v github.com/lzjluzijie/websocks/cmd/websocks-local
websocks-local -l :1080 -u wss://server.com/password
./websocks client -l :1080 -s wss://server.com/password
```

#### Caddyfile
Expand All @@ -39,8 +37,20 @@ https://server.com {
}
```

### TO-DO
### 内置 TLS

#### 服务端
```
./websocks cert
./websocks server -l :2333 -p /password --tls
```

#### 客户端
```
./websocks client -l :1080 -s wss://server.com/password
```

### TO-DO
- [ ] Config
- [ ] 优化代码
- [ ] ws复用
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Advantages:

The disadvantage is that I have just started development, there is no GUI client, and features are not enough. I will appreciate if you can help me!

### Example (Caddy TLS)
## Example

#### Server
### Caddy TLS

#### Server
```
./websocks server -l :2333 -p /password
```

#### Local

```
./websocks client -l :1080 -s wss://server.com/password
```
Expand All @@ -38,8 +38,20 @@ https://server.com {
}
```

### TO-DO
### Built-in TLS

#### Server
```
./websocks cert
./websocks server -l :2333 -p /password --tls
```

#### Local
```
./websocks client -l :1080 -s wss://server.com/password
```

### TO-DO
- [ ] Configuration
- [ ] Optimize code
- [ ] WebSocket mux
2 changes: 1 addition & 1 deletion core/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ func GenP256(hosts []string) (key, cert []byte, err error) {
}

key = pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: x509Key})
cert = pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: serverCert})
cert = pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: serverCert})
return
}
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func main() {
logger.Infof("Listening at %s", listenAddr)
err = server.Listen()
if err != nil {
logger.Errorf(err.Error())
return
}

return
Expand All @@ -170,8 +170,8 @@ func main() {
},
},
{
Name: "key",
Aliases: []string{"key"},
Name: "cert",
Aliases: []string{"cert"},
Usage: "generate self signed cert and key",
Flags: []cli.Flag{
cli.StringSliceFlag{
Expand Down

0 comments on commit d60277a

Please sign in to comment.