mirror of
https://github.com/fatedier/frp.git
synced 2024-12-15 19:21:01 +01:00
modify the getListener function && add TPS in dashboard
This commit is contained in:
parent
edf4bc431d
commit
d93dd82ed9
@ -25,6 +25,7 @@
|
||||
<th class="tab_info" ng-click="col='current_conns';desc=!desc">CurCon<i class="iconfont pull-right"></i></th>
|
||||
<th class="tab_info" ng-click="col='daily[daily.length-1].flow_out';desc=!desc">FlowOut<i class="iconfont pull-right"></i></th>
|
||||
<th class="tab_info" ng-click="col='daily[daily.length-1].flow_in';desc=!desc">FlowIn<i class="iconfont pull-right"></i></th>
|
||||
<th class="tab_info" ng-click="col='daily[daily.length-1].total_accept_conns';desc=!desc">TotalAcceptConns<i class="iconfont pull-right"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tab_body">
|
||||
@ -34,10 +35,11 @@
|
||||
</td>
|
||||
<td><span ng-bind="x.type"></span></td>
|
||||
<td><span ng-bind="x.listen_port"></span></td>
|
||||
<td><span ng-bind="x.status"></span></td>
|
||||
<td><span ng-bind="x.status_desc"></span></td>
|
||||
<td><span ng-bind="x.current_conns"></span></td>
|
||||
<td><span ng-bind="x.daily[x.daily.length-1].flow_out"></span></td>
|
||||
<td><span ng-bind="x.daily[x.daily.length-1].flow_in"></span></td>
|
||||
<td><span ng-bind="x.daily[x.daily.length-1].total_accept_conns"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -76,10 +76,19 @@ func (v *VhostMuxer) Listen(p *config.ProxyServerConf) (ls []*Listener) {
|
||||
return ls
|
||||
}
|
||||
|
||||
func (v *VhostMuxer) getListener(name string) (l *Listener, exist bool) {
|
||||
func (v *VhostMuxer) getListener(reqInfoMap map[string]string) (l *Listener, exist bool) {
|
||||
v.mutex.RLock()
|
||||
defer v.mutex.RUnlock()
|
||||
|
||||
//host
|
||||
name := strings.ToLower(reqInfoMap["Host"])
|
||||
|
||||
// http
|
||||
scheme := strings.ToLower(reqInfoMap["Scheme"])
|
||||
if scheme == "http" || scheme == "" {
|
||||
name = name + ":" + reqInfoMap["Path"]
|
||||
}
|
||||
|
||||
// // first we check the full hostname
|
||||
vr, found := v.registryRouter.get(name)
|
||||
if found {
|
||||
@ -126,12 +135,7 @@ func (v *VhostMuxer) handle(c *conn.Conn) {
|
||||
return
|
||||
}
|
||||
|
||||
name := strings.ToLower(reqInfoMap["Host"])
|
||||
// get listener by hostname
|
||||
if reqInfoMap["Scheme"] == "http" {
|
||||
name = name + ":" + reqInfoMap["Path"]
|
||||
}
|
||||
l, ok := v.getListener(name)
|
||||
l, ok := v.getListener(reqInfoMap)
|
||||
if !ok {
|
||||
c.Close()
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user