1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-23 16:05:24 +00:00

relocated browser forwarder interface

This commit is contained in:
Shelikhoo 2021-05-01 00:06:10 +01:00
parent ffc8887d79
commit 7a6f887fe3
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
3 changed files with 8 additions and 9 deletions

View File

@ -5,6 +5,7 @@ package browserforwarder
import (
"bytes"
"context"
"github.com/v2fly/v2ray-core/v4/features/extension"
"io"
"net/http"
"time"
@ -14,7 +15,6 @@ import (
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"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"
)
@ -47,7 +47,7 @@ func (f *Forwarder) DialWebsocket(url string, header http.Header) (io.ReadWriteC
}
func (f *Forwarder) Type() interface{} {
return ext.BrowserForwarderType()
return extension.BrowserForwarderType()
}
func (f *Forwarder) Start() error {

View File

@ -1,4 +1,4 @@
package ext
package extension
import (
"io"

View File

@ -6,13 +6,12 @@ import (
"bytes"
"context"
"encoding/base64"
"github.com/v2fly/v2ray-core/v4/features/extension"
"io"
"time"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/features/ext"
"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/net"
@ -62,8 +61,8 @@ func dialWebsocket(ctx context.Context, dest net.Destination, streamSettings *in
uri := protocol + "://" + host + wsSettings.GetNormalizedPath()
if wsSettings.UseBrowserForwarding {
var forwarder ext.BrowserForwarder
err := core.RequireFeatures(ctx, func(Forwarder ext.BrowserForwarder) {
var forwarder extension.BrowserForwarder
err := core.RequireFeatures(ctx, func(Forwarder extension.BrowserForwarder) {
forwarder = Forwarder
})
if err != nil {
@ -141,7 +140,7 @@ func (d dialerWithEarlyData) Dial(earlyData []byte) (*websocket.Conn, error) {
}
type dialerWithEarlyDataRelayed struct {
forwarder ext.BrowserForwarder
forwarder extension.BrowserForwarder
uriBase string
config *Config
}