mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 07:26:24 -05:00
relocated browser forwarder interface
This commit is contained in:
parent
ffc8887d79
commit
7a6f887fe3
@ -5,6 +5,7 @@ package browserforwarder
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
@ -14,7 +15,6 @@ import (
|
|||||||
"github.com/v2fly/v2ray-core/v4/common"
|
"github.com/v2fly/v2ray-core/v4/common"
|
||||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||||
"github.com/v2fly/v2ray-core/v4/common/platform/securedload"
|
"github.com/v2fly/v2ray-core/v4/common/platform/securedload"
|
||||||
"github.com/v2fly/v2ray-core/v4/features/ext"
|
|
||||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ func (f *Forwarder) DialWebsocket(url string, header http.Header) (io.ReadWriteC
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *Forwarder) Type() interface{} {
|
func (f *Forwarder) Type() interface{} {
|
||||||
return ext.BrowserForwarderType()
|
return extension.BrowserForwarderType()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Forwarder) Start() error {
|
func (f *Forwarder) Start() error {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package ext
|
package extension
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
@ -6,13 +6,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
core "github.com/v2fly/v2ray-core/v4"
|
|
||||||
"github.com/v2fly/v2ray-core/v4/features/ext"
|
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
|
core "github.com/v2fly/v2ray-core/v4"
|
||||||
|
|
||||||
"github.com/v2fly/v2ray-core/v4/common"
|
"github.com/v2fly/v2ray-core/v4/common"
|
||||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||||
@ -62,8 +61,8 @@ func dialWebsocket(ctx context.Context, dest net.Destination, streamSettings *in
|
|||||||
uri := protocol + "://" + host + wsSettings.GetNormalizedPath()
|
uri := protocol + "://" + host + wsSettings.GetNormalizedPath()
|
||||||
|
|
||||||
if wsSettings.UseBrowserForwarding {
|
if wsSettings.UseBrowserForwarding {
|
||||||
var forwarder ext.BrowserForwarder
|
var forwarder extension.BrowserForwarder
|
||||||
err := core.RequireFeatures(ctx, func(Forwarder ext.BrowserForwarder) {
|
err := core.RequireFeatures(ctx, func(Forwarder extension.BrowserForwarder) {
|
||||||
forwarder = Forwarder
|
forwarder = Forwarder
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -141,7 +140,7 @@ func (d dialerWithEarlyData) Dial(earlyData []byte) (*websocket.Conn, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type dialerWithEarlyDataRelayed struct {
|
type dialerWithEarlyDataRelayed struct {
|
||||||
forwarder ext.BrowserForwarder
|
forwarder extension.BrowserForwarder
|
||||||
uriBase string
|
uriBase string
|
||||||
config *Config
|
config *Config
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user