#5 添加身份验证auth_token

Open
opened 9 months ago by lyq · 1 comments
天问 commented 9 months ago

源码分析

在1.7版本源码中,已经有部分实现。在 src/ngrok/server/control.go#func NewControl 函数中 authMsg 参数访问控制。这个类:

type Auth struct {
	Version   string // protocol version
	MmVersion string // major/minor software version (informational only)
	User      string
	Password  string
	OS        string
	Arch      string
	ClientId  string // empty for new sessions
}

指定User 和Password,那么新建一个authtokens.txt ,其中包含用户名和密码列表。

client 命令行参数指定 --auth_token='usrename:password' 进行验证。

## 源码分析 在1.7版本源码中,已经有部分实现。在 `src/ngrok/server/control.go#func NewControl` 函数中 `authMsg` 参数访问控制。这个类: ``` type Auth struct { Version string // protocol version MmVersion string // major/minor software version (informational only) User string Password string OS string Arch string ClientId string // empty for new sessions } ``` 指定User 和Password,那么新建一个authtokens.txt ,其中包含用户名和密码列表。 client 命令行参数指定 --auth_token='usrename:password' 进行验证。
天问 commented 9 months ago
Owner

Reference

## Reference - [/prikevs/ngrok](https://github.com/prikevs/ngrok/commit/aa9b88d4e070069db6d8f88aa82526bcbcd1d0b6) - [ansiboy/mgrok](https://github.com/ansiboy/mgrok) 支持集群 - [zmide/ngrok](https://github.com/zmide/ngrok.git)
Sign in to join this conversation.
No Label
No Milestone
No assignee
1 Participants
Loading...
Cancel
Save
There is no content yet.