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

Commit

Permalink
fix signal
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li committed Jan 8, 2018
1 parent d3e515d commit 8e9b944
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
小程序王者头脑辅助工具


## 注意
本工具仅供辅助娱乐

## 如何使用

-`certs/goproxy.crt`传到手机, 安装证书
- pc机上运行 `go run cmd/main.go`
-`certs/goproxy.crt`传到手机, 点击安装证书
- 运行方法一: 在[release](https://github.com/sundy-li/wechat_brain/releases)页面下载对应的操作系统执行文件, 压缩后, 将`questions.data`文件下载到同一个目录
- 运行方法二: 安装go环境后, clone本repo源码到对应`$GOPATH/src/github.com/sundy-li/`下, 进入源码目录后,执行 `go run cmd/main.go`
- 手机wifi设置代理为pc的ip和端口,启动小程序王者头脑


## 运行示例
![自动提示标准答案](docs/2.jpg)

Expand Down
4 changes: 1 addition & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ package main
import (
"os"
"os/signal"
"syscall"

brain "github.com/sundy-li/wechat_brain"
)

func main() {
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGUSR1, syscall.SIGUSR2)
signal.Notify(c, os.Interrupt, os.Kill)
go func() {
brain.Run("8998")
//阻塞直至有信号传入
}()
<-c
brain.Close()
Expand Down

0 comments on commit 8e9b944

Please sign in to comment.