|
@@ -4,6 +4,7 @@ import (
|
|
"log"
|
|
"log"
|
|
"net/http"
|
|
"net/http"
|
|
"net/url"
|
|
"net/url"
|
|
|
|
+ "strings"
|
|
|
|
|
|
"imuslab.com/arozos/ReverseProxy/mod/websocketproxy"
|
|
"imuslab.com/arozos/ReverseProxy/mod/websocketproxy"
|
|
)
|
|
)
|
|
@@ -12,10 +13,16 @@ func (router *Router) getTargetProxyEndpointFromRequestURI(requestURI string) *P
|
|
var targetProxyEndpoint *ProxyEndpoint = nil
|
|
var targetProxyEndpoint *ProxyEndpoint = nil
|
|
router.ProxyEndpoints.Range(func(key, value interface{}) bool {
|
|
router.ProxyEndpoints.Range(func(key, value interface{}) bool {
|
|
rootname := key.(string)
|
|
rootname := key.(string)
|
|
- if len(requestURI) >= len(rootname) && requestURI[:len(rootname)] == rootname {
|
|
|
|
|
|
+ if strings.HasPrefix(requestURI, rootname) {
|
|
thisProxyEndpoint := value.(*ProxyEndpoint)
|
|
thisProxyEndpoint := value.(*ProxyEndpoint)
|
|
targetProxyEndpoint = thisProxyEndpoint
|
|
targetProxyEndpoint = thisProxyEndpoint
|
|
}
|
|
}
|
|
|
|
+ /*
|
|
|
|
+ if len(requestURI) >= len(rootname) && requestURI[:len(rootname)] == rootname {
|
|
|
|
+ thisProxyEndpoint := value.(*ProxyEndpoint)
|
|
|
|
+ targetProxyEndpoint = thisProxyEndpoint
|
|
|
|
+ }
|
|
|
|
+ */
|
|
return true
|
|
return true
|
|
})
|
|
})
|
|
|
|
|