mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Unify environment var readers
This commit is contained in:
parent
e241e5bda6
commit
4f05e0ac2b
9 changed files with 32 additions and 23 deletions
|
@ -8,12 +8,12 @@ import (
|
|||
"io"
|
||||
gonet "net"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/net"
|
||||
"github.com/xtls/xray-core/common/platform"
|
||||
"github.com/xtls/xray-core/common/session"
|
||||
"github.com/xtls/xray-core/transport/internet"
|
||||
"github.com/xtls/xray-core/transport/internet/stat"
|
||||
|
@ -26,7 +26,8 @@ var webpage []byte
|
|||
var conns chan *websocket.Conn
|
||||
|
||||
func init() {
|
||||
if addr := os.Getenv("XRAY_BROWSER_DIALER"); addr != "" {
|
||||
addr := platform.NewEnvFlag(platform.BrowserDialerAddress).GetValue(func() string { return "" })
|
||||
if addr != "" {
|
||||
conns = make(chan *websocket.Conn, 256)
|
||||
go http.ListenAndServe(addr, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path == "/websocket" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue