Compare commits
81 Commits
v1.0-beta1
...
v1.0.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1635c98783 | ||
|
|
cbcaa0f590 | ||
|
|
763b93c021 | ||
|
|
00da3e0765 | ||
|
|
46d7a78158 | ||
|
|
de3f70195e | ||
|
|
3105b8c920 | ||
|
|
4c67ab1a54 | ||
|
|
84783c5359 | ||
|
|
22b16f82bd | ||
|
|
d2add33723 | ||
|
|
ab0daf31c1 | ||
|
|
3d94b948dd | ||
|
|
1659ae5d79 | ||
|
|
7279855b08 | ||
|
|
925fbca363 | ||
|
|
a5163e3e3c | ||
|
|
62859e0c6b | ||
|
|
a37cab48d2 | ||
|
|
c586c8f361 | ||
|
|
e68fa3e12d | ||
|
|
7f5b9e0e3b | ||
|
|
f7bed32c6f | ||
|
|
ef7f2d82c0 | ||
|
|
7aa97a332e | ||
|
|
7c30dde96b | ||
|
|
9cef2a0a8f | ||
|
|
f376683fc3 | ||
|
|
4b61d6e875 | ||
|
|
7d83e350fd | ||
|
|
500ba69548 | ||
|
|
9a422549b1 | ||
|
|
3b48fa455e | ||
|
|
ef013e0639 | ||
|
|
8f8437a88d | ||
|
|
1b091c9b07 | ||
|
|
4801b6f057 | ||
|
|
9078bc2de5 | ||
|
|
b69464dfe9 | ||
|
|
62fa48293a | ||
|
|
b206d0889b | ||
|
|
ee691d81bf | ||
|
|
56876a67cc | ||
|
|
4a0df713aa | ||
|
|
ef801cbfbe | ||
|
|
9378fc88d2 | ||
|
|
f46bfcc3d8 | ||
|
|
ccdb238843 | ||
|
|
f1f61b4e2b | ||
|
|
a44cb745d9 | ||
|
|
f5f5cb023c | ||
|
|
5813e0ce7a | ||
|
|
5a9c2b1e80 | ||
|
|
bda34fdb3b | ||
|
|
426b677eb8 | ||
|
|
67c7e9fd86 | ||
|
|
d8028a8632 | ||
|
|
374743d022 | ||
|
|
cd98ea5008 | ||
|
|
dbda0ed98a | ||
|
|
f5e0ead01c | ||
|
|
44818701bc | ||
|
|
e0f7387dff | ||
|
|
d440a01792 | ||
|
|
665c84ee42 | ||
|
|
e0de96eb4c | ||
|
|
c6ef276811 | ||
|
|
1701aaf78c | ||
|
|
122daa4bfb | ||
|
|
561a9e5275 | ||
|
|
de2453fce9 | ||
|
|
d59d40c118 | ||
|
|
3469df001f | ||
|
|
0d8cfa3031 | ||
|
|
0289586880 | ||
|
|
e46427c7fc | ||
|
|
3ea59d9a8e | ||
|
|
e85dfc6adf | ||
|
|
d0703b78fa | ||
|
|
432e6adf3e | ||
|
|
a057754035 |
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -31,7 +31,7 @@ body:
|
|||||||
<details>
|
<details>
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ sing-box --version
|
$ sing-box version
|
||||||
# Paste output here
|
# Paste output here
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
7
.github/update_dependencies.sh
vendored
7
.github/update_dependencies.sh
vendored
@@ -1,10 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PROJECTS=$(dirname "$0")/../..
|
PROJECTS=$(dirname "$0")/../..
|
||||||
|
go get -x github.com/sagernet/$1@$(git -C $PROJECTS/$1 rev-parse HEAD)
|
||||||
go get -x github.com/sagernet/sing@$(git -C $PROJECTS/sing rev-parse HEAD)
|
|
||||||
go get -x github.com/sagernet/sing-dns@$(git -C $PROJECTS/sing-dns rev-parse HEAD)
|
|
||||||
go get -x github.com/sagernet/sing-tun@$(git -C $PROJECTS/sing-tun rev-parse HEAD)
|
|
||||||
go get -x github.com/sagernet/sing-shadowsocks@$(git -C $PROJECTS/sing-shadowsocks rev-parse HEAD)
|
|
||||||
go get -x github.com/sagernet/sing-vmess@$(git -C $PROJECTS/sing-vmess rev-parse HEAD)
|
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
|||||||
4
.github/workflows/debug.yml
vendored
4
.github/workflows/debug.yml
vendored
@@ -3,14 +3,18 @@ name: Debug build
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- main
|
||||||
- dev
|
- dev
|
||||||
|
- dev-next
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- '.github/**'
|
- '.github/**'
|
||||||
- '!.github/workflows/debug.yml'
|
- '!.github/workflows/debug.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
|
- main
|
||||||
- dev
|
- dev
|
||||||
|
- dev-next
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
43
.github/workflows/docker.yml
vendored
Normal file
43
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: Build Docker Images
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: "The tag version you want to build"
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Docker metadata
|
||||||
|
id: metadata
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: ghcr.io/sagernet/sing-box
|
||||||
|
- name: Get tag to build
|
||||||
|
id: tag
|
||||||
|
run: |
|
||||||
|
if [[ -z "${{ github.event.inputs.tag }}" ]]; then
|
||||||
|
echo ::set-output name=tag::ghcr.io/sagernet/sing-box:${{ github.ref_name }}
|
||||||
|
else
|
||||||
|
echo ::set-output name=tag::ghcr.io/sagernet/sing-box:${{ github.event.inputs.tag }}
|
||||||
|
fi
|
||||||
|
- name: Build and release Docker images
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
platforms: linux/386,linux/amd64
|
||||||
|
target: dist
|
||||||
|
tags: ${{ steps.tag.outputs.tag }}
|
||||||
|
push: true
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,4 +4,5 @@
|
|||||||
/*.db
|
/*.db
|
||||||
/site/
|
/site/
|
||||||
/bin/
|
/bin/
|
||||||
/dist/
|
/dist/
|
||||||
|
/sing-box
|
||||||
@@ -13,11 +13,13 @@ builds:
|
|||||||
tags:
|
tags:
|
||||||
- with_quic
|
- with_quic
|
||||||
- with_wireguard
|
- with_wireguard
|
||||||
- with_acme
|
|
||||||
- with_clash_api
|
- with_clash_api
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
targets:
|
targets:
|
||||||
|
- android_arm64
|
||||||
|
- android_amd64
|
||||||
|
- android_amd64_v3
|
||||||
- linux_amd64_v1
|
- linux_amd64_v1
|
||||||
- linux_amd64_v3
|
- linux_amd64_v3
|
||||||
- linux_arm64
|
- linux_arm64
|
||||||
|
|||||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
FROM golang:1.19-alpine AS builder
|
||||||
|
LABEL maintainer="nekohasekai <contact-git@sekai.icu>"
|
||||||
|
COPY . /go/src/github.com/sagernet/sing-box
|
||||||
|
WORKDIR /go/src/github.com/sagernet/sing-box
|
||||||
|
ARG GOPROXY=""
|
||||||
|
ENV GOPROXY ${GOPROXY}
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
|
RUN set -ex \
|
||||||
|
&& apk add git build-base \
|
||||||
|
&& export COMMIT=$(git rev-parse --short HEAD) \
|
||||||
|
&& go build -v -trimpath -tags 'no_gvisor,with_quic,with_wireguard,with_acme' \
|
||||||
|
-o /go/bin/sing-box \
|
||||||
|
-ldflags "-X github.com/sagernet/sing-box/constant.Commit=${COMMIT} -w -s -buildid=" \
|
||||||
|
./cmd/sing-box
|
||||||
|
FROM alpine AS dist
|
||||||
|
LABEL maintainer="nekohasekai <contact-git@sekai.icu>"
|
||||||
|
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||||
|
RUN set -ex \
|
||||||
|
&& apk upgrade \
|
||||||
|
&& apk add bash tzdata ca-certificates \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
COPY --from=builder /go/bin/sing-box /usr/local/bin/sing-box
|
||||||
|
ENTRYPOINT ["sing-box"]
|
||||||
@@ -2,11 +2,13 @@ package adapter
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/common/process"
|
"github.com/sagernet/sing-box/common/process"
|
||||||
"github.com/sagernet/sing-dns"
|
"github.com/sagernet/sing-dns"
|
||||||
M "github.com/sagernet/sing/common/metadata"
|
M "github.com/sagernet/sing/common/metadata"
|
||||||
|
N "github.com/sagernet/sing/common/network"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Inbound interface {
|
type Inbound interface {
|
||||||
@@ -15,6 +17,13 @@ type Inbound interface {
|
|||||||
Tag() string
|
Tag() string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type InjectableInbound interface {
|
||||||
|
Inbound
|
||||||
|
Network() []string
|
||||||
|
NewConnection(ctx context.Context, conn net.Conn, metadata InboundContext) error
|
||||||
|
NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext) error
|
||||||
|
}
|
||||||
|
|
||||||
type InboundContext struct {
|
type InboundContext struct {
|
||||||
Inbound string
|
Inbound string
|
||||||
InboundType string
|
InboundType string
|
||||||
@@ -29,6 +38,8 @@ type InboundContext struct {
|
|||||||
|
|
||||||
// cache
|
// cache
|
||||||
|
|
||||||
|
InboundDetour string
|
||||||
|
LastInbound string
|
||||||
OriginDestination M.Socksaddr
|
OriginDestination M.Socksaddr
|
||||||
DomainStrategy dns.DomainStrategy
|
DomainStrategy dns.DomainStrategy
|
||||||
SniffEnabled bool
|
SniffEnabled bool
|
||||||
|
|||||||
@@ -38,13 +38,25 @@ type myUpstreamHandlerWrapper struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *myUpstreamHandlerWrapper) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error {
|
func (w *myUpstreamHandlerWrapper) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error {
|
||||||
w.metadata.Destination = metadata.Destination
|
myMetadata := w.metadata
|
||||||
return w.connectionHandler(ctx, conn, w.metadata)
|
if metadata.Source.IsValid() {
|
||||||
|
myMetadata.Source = metadata.Source
|
||||||
|
}
|
||||||
|
if metadata.Destination.IsValid() {
|
||||||
|
myMetadata.Destination = metadata.Destination
|
||||||
|
}
|
||||||
|
return w.connectionHandler(ctx, conn, myMetadata)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *myUpstreamHandlerWrapper) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata M.Metadata) error {
|
func (w *myUpstreamHandlerWrapper) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata M.Metadata) error {
|
||||||
w.metadata.Destination = metadata.Destination
|
myMetadata := w.metadata
|
||||||
return w.packetHandler(ctx, conn, w.metadata)
|
if metadata.Source.IsValid() {
|
||||||
|
myMetadata.Source = metadata.Source
|
||||||
|
}
|
||||||
|
if metadata.Destination.IsValid() {
|
||||||
|
myMetadata.Destination = metadata.Destination
|
||||||
|
}
|
||||||
|
return w.packetHandler(ctx, conn, myMetadata)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *myUpstreamHandlerWrapper) NewError(ctx context.Context, err error) {
|
func (w *myUpstreamHandlerWrapper) NewError(ctx context.Context, err error) {
|
||||||
@@ -78,13 +90,23 @@ func NewUpstreamContextHandler(
|
|||||||
|
|
||||||
func (w *myUpstreamContextHandlerWrapper) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error {
|
func (w *myUpstreamContextHandlerWrapper) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error {
|
||||||
myMetadata := ContextFrom(ctx)
|
myMetadata := ContextFrom(ctx)
|
||||||
myMetadata.Destination = metadata.Destination
|
if metadata.Source.IsValid() {
|
||||||
|
myMetadata.Source = metadata.Source
|
||||||
|
}
|
||||||
|
if metadata.Destination.IsValid() {
|
||||||
|
myMetadata.Destination = metadata.Destination
|
||||||
|
}
|
||||||
return w.connectionHandler(ctx, conn, *myMetadata)
|
return w.connectionHandler(ctx, conn, *myMetadata)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *myUpstreamContextHandlerWrapper) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata M.Metadata) error {
|
func (w *myUpstreamContextHandlerWrapper) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata M.Metadata) error {
|
||||||
myMetadata := ContextFrom(ctx)
|
myMetadata := ContextFrom(ctx)
|
||||||
myMetadata.Destination = metadata.Destination
|
if metadata.Source.IsValid() {
|
||||||
|
myMetadata.Source = metadata.Source
|
||||||
|
}
|
||||||
|
if metadata.Destination.IsValid() {
|
||||||
|
myMetadata.Destination = metadata.Destination
|
||||||
|
}
|
||||||
return w.packetHandler(ctx, conn, *myMetadata)
|
return w.packetHandler(ctx, conn, *myMetadata)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
box.go
2
box.go
@@ -138,7 +138,7 @@ func New(ctx context.Context, options option.Options) (*Box, error) {
|
|||||||
}
|
}
|
||||||
outbounds = append(outbounds, out)
|
outbounds = append(outbounds, out)
|
||||||
}
|
}
|
||||||
err = router.Initialize(outbounds, func() adapter.Outbound {
|
err = router.Initialize(inbounds, outbounds, func() adapter.Outbound {
|
||||||
out, oErr := outbound.New(ctx, router, logFactory.NewLogger("outbound/direct"), option.Outbound{Type: "direct", Tag: "default"})
|
out, oErr := outbound.New(ctx, router, logFactory.NewLogger("outbound/direct"), option.Outbound{Type: "direct", Tag: "default"})
|
||||||
common.Must(oErr)
|
common.Must(oErr)
|
||||||
outbounds = append(outbounds, out)
|
outbounds = append(outbounds, out)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ func format() error {
|
|||||||
return E.Cause(err, "read config")
|
return E.Cause(err, "read config")
|
||||||
}
|
}
|
||||||
var options option.Options
|
var options option.Options
|
||||||
err = json.Unmarshal(configContent, &options)
|
err = options.UnmarshalJSON(configContent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return E.Cause(err, "decode config")
|
return E.Cause(err, "decode config")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box"
|
"github.com/sagernet/sing-box"
|
||||||
"github.com/sagernet/sing-box/common/json"
|
|
||||||
"github.com/sagernet/sing-box/log"
|
"github.com/sagernet/sing-box/log"
|
||||||
"github.com/sagernet/sing-box/option"
|
"github.com/sagernet/sing-box/option"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
@@ -46,7 +45,7 @@ func readConfig() (option.Options, error) {
|
|||||||
return option.Options{}, E.Cause(err, "read config")
|
return option.Options{}, E.Cause(err, "read config")
|
||||||
}
|
}
|
||||||
var options option.Options
|
var options option.Options
|
||||||
err = json.Unmarshal(configContent, &options)
|
err = options.UnmarshalJSON(configContent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return option.Options{}, E.Cause(err, "decode config")
|
return option.Options{}, E.Cause(err, "decode config")
|
||||||
}
|
}
|
||||||
|
|||||||
62
common/baderror/baderror.go
Normal file
62
common/baderror/baderror.go
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
package baderror
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
"net"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Contains(err error, msgList ...string) bool {
|
||||||
|
for _, msg := range msgList {
|
||||||
|
if strings.Contains(err.Error(), msg) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func WrapH2(err error) error {
|
||||||
|
if err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
err = E.Unwrap(err)
|
||||||
|
if err == io.ErrUnexpectedEOF {
|
||||||
|
return io.EOF
|
||||||
|
}
|
||||||
|
if Contains(err, "client disconnected", "body closed by handler") {
|
||||||
|
return net.ErrClosed
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func WrapGRPC(err error) error {
|
||||||
|
// grpc uses stupid internal error types
|
||||||
|
if err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if Contains(err, "EOF") {
|
||||||
|
return io.EOF
|
||||||
|
}
|
||||||
|
if Contains(err, "Canceled") {
|
||||||
|
return context.Canceled
|
||||||
|
}
|
||||||
|
if Contains(err,
|
||||||
|
"the client connection is closing",
|
||||||
|
"server closed the stream without sending trailers") {
|
||||||
|
return net.ErrClosed
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func WrapQUIC(err error) error {
|
||||||
|
if err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if Contains(err, "canceled with error code 0") {
|
||||||
|
return net.ErrClosed
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package dialer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"syscall"
|
|
||||||
|
|
||||||
"github.com/sagernet/sing/common/control"
|
|
||||||
M "github.com/sagernet/sing/common/metadata"
|
|
||||||
N "github.com/sagernet/sing/common/network"
|
|
||||||
)
|
|
||||||
|
|
||||||
func skipIfPrivate(next control.Func) control.Func {
|
|
||||||
return func(network, address string, conn syscall.RawConn) error {
|
|
||||||
destination := M.ParseSocksaddr(address)
|
|
||||||
if !N.IsPublicAddr(destination.Addr) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return next(network, address, conn)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
C "github.com/sagernet/sing-box/constant"
|
C "github.com/sagernet/sing-box/constant"
|
||||||
"github.com/sagernet/sing-box/option"
|
"github.com/sagernet/sing-box/option"
|
||||||
"github.com/sagernet/sing/common/control"
|
"github.com/sagernet/sing/common/control"
|
||||||
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
M "github.com/sagernet/sing/common/metadata"
|
M "github.com/sagernet/sing/common/metadata"
|
||||||
N "github.com/sagernet/sing/common/network"
|
N "github.com/sagernet/sing/common/network"
|
||||||
|
|
||||||
@@ -64,25 +65,25 @@ func NewDefault(router adapter.Router, options option.DialerOptions) *DefaultDia
|
|||||||
var listener net.ListenConfig
|
var listener net.ListenConfig
|
||||||
if options.BindInterface != "" {
|
if options.BindInterface != "" {
|
||||||
warnBindInterfaceOnUnsupportedPlatform.Check()
|
warnBindInterfaceOnUnsupportedPlatform.Check()
|
||||||
bindFunc := skipIfPrivate(control.BindToInterface(router.InterfaceBindManager(), options.BindInterface))
|
bindFunc := control.BindToInterface(router.InterfaceBindManager(), options.BindInterface)
|
||||||
dialer.Control = control.Append(dialer.Control, bindFunc)
|
dialer.Control = control.Append(dialer.Control, bindFunc)
|
||||||
listener.Control = control.Append(listener.Control, bindFunc)
|
listener.Control = control.Append(listener.Control, bindFunc)
|
||||||
} else if router.AutoDetectInterface() {
|
} else if router.AutoDetectInterface() {
|
||||||
if C.IsWindows {
|
if C.IsWindows {
|
||||||
bindFunc := skipIfPrivate(control.BindToInterfaceIndexFunc(func() int {
|
bindFunc := control.BindToInterfaceIndexFunc(func(network, address string) int {
|
||||||
return router.InterfaceMonitor().DefaultInterfaceIndex()
|
return router.InterfaceMonitor().DefaultInterfaceIndex(M.ParseSocksaddr(address).Addr)
|
||||||
}))
|
})
|
||||||
dialer.Control = control.Append(dialer.Control, bindFunc)
|
dialer.Control = control.Append(dialer.Control, bindFunc)
|
||||||
listener.Control = control.Append(listener.Control, bindFunc)
|
listener.Control = control.Append(listener.Control, bindFunc)
|
||||||
} else {
|
} else {
|
||||||
bindFunc := skipIfPrivate(control.BindToInterfaceFunc(router.InterfaceBindManager(), func() string {
|
bindFunc := control.BindToInterfaceFunc(router.InterfaceBindManager(), func(network, address string) string {
|
||||||
return router.InterfaceMonitor().DefaultInterfaceName()
|
return router.InterfaceMonitor().DefaultInterfaceName(M.ParseSocksaddr(address).Addr)
|
||||||
}))
|
})
|
||||||
dialer.Control = control.Append(dialer.Control, bindFunc)
|
dialer.Control = control.Append(dialer.Control, bindFunc)
|
||||||
listener.Control = control.Append(listener.Control, bindFunc)
|
listener.Control = control.Append(listener.Control, bindFunc)
|
||||||
}
|
}
|
||||||
} else if router.DefaultInterface() != "" {
|
} else if router.DefaultInterface() != "" {
|
||||||
bindFunc := skipIfPrivate(control.BindToInterface(router.InterfaceBindManager(), router.DefaultInterface()))
|
bindFunc := control.BindToInterface(router.InterfaceBindManager(), router.DefaultInterface())
|
||||||
dialer.Control = control.Append(dialer.Control, bindFunc)
|
dialer.Control = control.Append(dialer.Control, bindFunc)
|
||||||
listener.Control = control.Append(listener.Control, bindFunc)
|
listener.Control = control.Append(listener.Control, bindFunc)
|
||||||
}
|
}
|
||||||
@@ -130,6 +131,9 @@ func NewDefault(router adapter.Router, options option.DialerOptions) *DefaultDia
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *DefaultDialer) DialContext(ctx context.Context, network string, address M.Socksaddr) (net.Conn, error) {
|
func (d *DefaultDialer) DialContext(ctx context.Context, network string, address M.Socksaddr) (net.Conn, error) {
|
||||||
|
if !address.IsValid() {
|
||||||
|
return nil, E.New("invalid address")
|
||||||
|
}
|
||||||
switch N.NetworkName(network) {
|
switch N.NetworkName(network) {
|
||||||
case N.NetworkUDP:
|
case N.NetworkUDP:
|
||||||
return d.udpDialer.DialContext(ctx, network, address.String())
|
return d.udpDialer.DialContext(ctx, network, address.String())
|
||||||
|
|||||||
@@ -10,15 +10,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func New(router adapter.Router, options option.DialerOptions) N.Dialer {
|
func New(router adapter.Router, options option.DialerOptions) N.Dialer {
|
||||||
|
var dialer N.Dialer
|
||||||
if options.Detour == "" {
|
if options.Detour == "" {
|
||||||
return NewDefault(router, options)
|
dialer = NewDefault(router, options)
|
||||||
} else {
|
} else {
|
||||||
return NewDetour(router, options.Detour)
|
dialer = NewDetour(router, options.Detour)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func NewOutbound(router adapter.Router, options option.OutboundDialerOptions) N.Dialer {
|
|
||||||
dialer := New(router, options.DialerOptions)
|
|
||||||
domainStrategy := dns.DomainStrategy(options.DomainStrategy)
|
domainStrategy := dns.DomainStrategy(options.DomainStrategy)
|
||||||
if domainStrategy != dns.DomainStrategyAsIS || options.Detour == "" {
|
if domainStrategy != dns.DomainStrategyAsIS || options.Detour == "" {
|
||||||
dialer = NewResolveDialer(router, dialer, domainStrategy, time.Duration(options.FallbackDelay))
|
dialer = NewResolveDialer(router, dialer, domainStrategy, time.Duration(options.FallbackDelay))
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ func (d *ResolveDialer) DialContext(ctx context.Context, network string, destina
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *ResolveDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error) {
|
func (d *ResolveDialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error) {
|
||||||
if !destination.IsFqdn() || destination.Fqdn == "" {
|
if !destination.IsFqdn() {
|
||||||
return d.dialer.ListenPacket(ctx, destination)
|
return d.dialer.ListenPacket(ctx, destination)
|
||||||
}
|
}
|
||||||
ctx, metadata := adapter.AppendContext(ctx)
|
ctx, metadata := adapter.AppendContext(ctx)
|
||||||
|
|||||||
@@ -18,21 +18,21 @@ func NewSearcher(config Config) (Searcher, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *androidSearcher) FindProcessInfo(ctx context.Context, network string, source netip.AddrPort, destination netip.AddrPort) (*Info, error) {
|
func (s *androidSearcher) FindProcessInfo(ctx context.Context, network string, source netip.AddrPort, destination netip.AddrPort) (*Info, error) {
|
||||||
socket, err := resolveSocketByNetlink(network, source, destination)
|
_, uid, err := resolveSocketByNetlink(network, source, destination)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if sharedPackage, loaded := s.packageManager.SharedPackageByID(socket.UID); loaded {
|
if sharedPackage, loaded := s.packageManager.SharedPackageByID(uid % 100000); loaded {
|
||||||
return &Info{
|
return &Info{
|
||||||
UserId: int32(socket.UID),
|
UserId: int32(uid),
|
||||||
PackageName: sharedPackage,
|
PackageName: sharedPackage,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
if packageName, loaded := s.packageManager.PackageByID(socket.UID); loaded {
|
if packageName, loaded := s.packageManager.PackageByID(uid % 100000); loaded {
|
||||||
return &Info{
|
return &Info{
|
||||||
UserId: int32(socket.UID),
|
UserId: int32(uid),
|
||||||
PackageName: packageName,
|
PackageName: packageName,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
return &Info{UserId: int32(socket.UID)}, nil
|
return &Info{UserId: int32(uid)}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ func NewSearcher(config Config) (Searcher, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *linuxSearcher) FindProcessInfo(ctx context.Context, network string, source netip.AddrPort, destination netip.AddrPort) (*Info, error) {
|
func (s *linuxSearcher) FindProcessInfo(ctx context.Context, network string, source netip.AddrPort, destination netip.AddrPort) (*Info, error) {
|
||||||
socket, err := resolveSocketByNetlink(network, source, destination)
|
inode, uid, err := resolveSocketByNetlink(network, source, destination)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
processPath, err := resolveProcessNameByProcSearch(socket.INode, socket.UID)
|
processPath, err := resolveProcessNameByProcSearch(inode, uid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.DebugContext(ctx, "find process path: ", err)
|
s.logger.DebugContext(ctx, "find process path: ", err)
|
||||||
}
|
}
|
||||||
return &Info{
|
return &Info{
|
||||||
UserId: int32(socket.UID),
|
UserId: int32(uid),
|
||||||
ProcessPath: processPath,
|
ProcessPath: processPath,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@@ -14,7 +15,9 @@ import (
|
|||||||
"unicode"
|
"unicode"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/sagernet/netlink"
|
"github.com/sagernet/sing/common"
|
||||||
|
"github.com/sagernet/sing/common/buf"
|
||||||
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
N "github.com/sagernet/sing/common/network"
|
N "github.com/sagernet/sing/common/network"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,7 +37,7 @@ const (
|
|||||||
pathProc = "/proc"
|
pathProc = "/proc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func resolveSocketByNetlink(network string, source netip.AddrPort, destination netip.AddrPort) (*netlink.Socket, error) {
|
func resolveSocketByNetlink(network string, source netip.AddrPort, destination netip.AddrPort) (inode, uid uint32, err error) {
|
||||||
var family uint8
|
var family uint8
|
||||||
var protocol uint8
|
var protocol uint8
|
||||||
|
|
||||||
@@ -44,28 +47,110 @@ func resolveSocketByNetlink(network string, source netip.AddrPort, destination n
|
|||||||
case N.NetworkUDP:
|
case N.NetworkUDP:
|
||||||
protocol = syscall.IPPROTO_UDP
|
protocol = syscall.IPPROTO_UDP
|
||||||
default:
|
default:
|
||||||
return nil, os.ErrInvalid
|
return 0, 0, os.ErrInvalid
|
||||||
}
|
}
|
||||||
|
|
||||||
if source.Addr().Is4() {
|
if source.Addr().Is4() {
|
||||||
family = syscall.AF_INET
|
family = syscall.AF_INET
|
||||||
} else {
|
} else {
|
||||||
family = syscall.AF_INET6
|
family = syscall.AF_INET6
|
||||||
}
|
}
|
||||||
sockets, err := netlink.SocketGet(family, protocol, source, netip.AddrPortFrom(netip.IPv6Unspecified(), 0))
|
|
||||||
if err == nil {
|
req := packSocketDiagRequest(family, protocol, source)
|
||||||
sockets, err = netlink.SocketGet(family, protocol, source, destination)
|
|
||||||
}
|
socket, err := syscall.Socket(syscall.AF_NETLINK, syscall.SOCK_DGRAM, syscall.NETLINK_INET_DIAG)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return 0, 0, E.Cause(err, "dial netlink")
|
||||||
}
|
}
|
||||||
if len(sockets) > 1 {
|
defer syscall.Close(socket)
|
||||||
for _, socket := range sockets {
|
|
||||||
if socket.ID.DestinationPort == destination.Port() {
|
syscall.SetsockoptTimeval(socket, syscall.SOL_SOCKET, syscall.SO_SNDTIMEO, &syscall.Timeval{Usec: 100})
|
||||||
return socket, nil
|
syscall.SetsockoptTimeval(socket, syscall.SOL_SOCKET, syscall.SO_RCVTIMEO, &syscall.Timeval{Usec: 100})
|
||||||
}
|
|
||||||
}
|
err = syscall.Connect(socket, &syscall.SockaddrNetlink{
|
||||||
|
Family: syscall.AF_NETLINK,
|
||||||
|
Pad: 0,
|
||||||
|
Pid: 0,
|
||||||
|
Groups: 0,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return sockets[0], nil
|
|
||||||
|
_, err = syscall.Write(socket, req)
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, E.Cause(err, "write netlink request")
|
||||||
|
}
|
||||||
|
|
||||||
|
_buffer := buf.StackNew()
|
||||||
|
defer common.KeepAlive(_buffer)
|
||||||
|
buffer := common.Dup(_buffer)
|
||||||
|
defer buffer.Release()
|
||||||
|
|
||||||
|
n, err := syscall.Read(socket, buffer.FreeBytes())
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, E.Cause(err, "read netlink response")
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer.Truncate(n)
|
||||||
|
|
||||||
|
messages, err := syscall.ParseNetlinkMessage(buffer.Bytes())
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, E.Cause(err, "parse netlink message")
|
||||||
|
} else if len(messages) == 0 {
|
||||||
|
return 0, 0, E.New("unexcepted netlink response")
|
||||||
|
}
|
||||||
|
|
||||||
|
message := messages[0]
|
||||||
|
if message.Header.Type&syscall.NLMSG_ERROR != 0 {
|
||||||
|
return 0, 0, E.New("netlink message: NLMSG_ERROR")
|
||||||
|
}
|
||||||
|
|
||||||
|
inode, uid = unpackSocketDiagResponse(&messages[0])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func packSocketDiagRequest(family, protocol byte, source netip.AddrPort) []byte {
|
||||||
|
s := make([]byte, 16)
|
||||||
|
copy(s, source.Addr().AsSlice())
|
||||||
|
|
||||||
|
buf := make([]byte, sizeOfSocketDiagRequest)
|
||||||
|
|
||||||
|
nativeEndian.PutUint32(buf[0:4], sizeOfSocketDiagRequest)
|
||||||
|
nativeEndian.PutUint16(buf[4:6], socketDiagByFamily)
|
||||||
|
nativeEndian.PutUint16(buf[6:8], syscall.NLM_F_REQUEST|syscall.NLM_F_DUMP)
|
||||||
|
nativeEndian.PutUint32(buf[8:12], 0)
|
||||||
|
nativeEndian.PutUint32(buf[12:16], 0)
|
||||||
|
|
||||||
|
buf[16] = family
|
||||||
|
buf[17] = protocol
|
||||||
|
buf[18] = 0
|
||||||
|
buf[19] = 0
|
||||||
|
nativeEndian.PutUint32(buf[20:24], 0xFFFFFFFF)
|
||||||
|
|
||||||
|
binary.BigEndian.PutUint16(buf[24:26], source.Port())
|
||||||
|
binary.BigEndian.PutUint16(buf[26:28], 0)
|
||||||
|
|
||||||
|
copy(buf[28:44], s)
|
||||||
|
copy(buf[44:60], net.IPv6zero)
|
||||||
|
|
||||||
|
nativeEndian.PutUint32(buf[60:64], 0)
|
||||||
|
nativeEndian.PutUint64(buf[64:72], 0xFFFFFFFFFFFFFFFF)
|
||||||
|
|
||||||
|
return buf
|
||||||
|
}
|
||||||
|
|
||||||
|
func unpackSocketDiagResponse(msg *syscall.NetlinkMessage) (inode, uid uint32) {
|
||||||
|
if len(msg.Data) < 72 {
|
||||||
|
return 0, 0
|
||||||
|
}
|
||||||
|
|
||||||
|
data := msg.Data
|
||||||
|
|
||||||
|
uid = nativeEndian.Uint32(data[64:68])
|
||||||
|
inode = nativeEndian.Uint32(data[68:72])
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func resolveProcessNameByProcSearch(inode, uid uint32) (string, error) {
|
func resolveProcessNameByProcSearch(inode, uid uint32) (string, error) {
|
||||||
|
|||||||
64
common/redir/redir_darwin.go
Normal file
64
common/redir/redir_darwin.go
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
package redir
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
"net/netip"
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
|
||||||
|
M "github.com/sagernet/sing/common/metadata"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
PF_OUT = 0x2
|
||||||
|
DIOCNATLOOK = 0xc0544417
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetOriginalDestination(conn net.Conn) (destination netip.AddrPort, err error) {
|
||||||
|
fd, err := syscall.Open("/dev/pf", 0, syscall.O_RDONLY)
|
||||||
|
if err != nil {
|
||||||
|
return netip.AddrPort{}, err
|
||||||
|
}
|
||||||
|
defer syscall.Close(fd)
|
||||||
|
nl := struct {
|
||||||
|
saddr, daddr, rsaddr, rdaddr [16]byte
|
||||||
|
sxport, dxport, rsxport, rdxport [4]byte
|
||||||
|
af, proto, protoVariant, direction uint8
|
||||||
|
}{
|
||||||
|
af: syscall.AF_INET,
|
||||||
|
proto: syscall.IPPROTO_TCP,
|
||||||
|
direction: PF_OUT,
|
||||||
|
}
|
||||||
|
la := conn.LocalAddr().(*net.TCPAddr)
|
||||||
|
ra := conn.RemoteAddr().(*net.TCPAddr)
|
||||||
|
raIP, laIP := ra.IP, la.IP
|
||||||
|
raPort, laPort := ra.Port, la.Port
|
||||||
|
switch {
|
||||||
|
case raIP.To4() != nil:
|
||||||
|
copy(nl.saddr[:net.IPv4len], raIP.To4())
|
||||||
|
copy(nl.daddr[:net.IPv4len], laIP.To4())
|
||||||
|
nl.af = syscall.AF_INET
|
||||||
|
default:
|
||||||
|
copy(nl.saddr[:], raIP.To16())
|
||||||
|
copy(nl.daddr[:], laIP.To16())
|
||||||
|
nl.af = syscall.AF_INET6
|
||||||
|
}
|
||||||
|
nl.sxport[0], nl.sxport[1] = byte(raPort>>8), byte(raPort)
|
||||||
|
nl.dxport[0], nl.dxport[1] = byte(laPort>>8), byte(laPort)
|
||||||
|
if _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), DIOCNATLOOK, uintptr(unsafe.Pointer(&nl))); errno != 0 {
|
||||||
|
return netip.AddrPort{}, errno
|
||||||
|
}
|
||||||
|
|
||||||
|
var ip net.IP
|
||||||
|
switch nl.af {
|
||||||
|
case syscall.AF_INET:
|
||||||
|
ip = make(net.IP, net.IPv4len)
|
||||||
|
copy(ip, nl.rdaddr[:net.IPv4len])
|
||||||
|
case syscall.AF_INET6:
|
||||||
|
ip = make(net.IP, net.IPv6len)
|
||||||
|
copy(ip, nl.rdaddr[:])
|
||||||
|
}
|
||||||
|
port := uint16(nl.rdxport[0])<<8 | uint16(nl.rdxport[1])
|
||||||
|
destination = netip.AddrPortFrom(M.AddrFromIP(ip), port)
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
//go:build !linux
|
//go:build !linux && !darwin
|
||||||
|
|
||||||
package redir
|
package redir
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package settings
|
package settings
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/netip"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
@@ -20,7 +21,7 @@ type systemProxy struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *systemProxy) update() error {
|
func (p *systemProxy) update() error {
|
||||||
newInterfaceName := p.monitor.DefaultInterfaceName()
|
newInterfaceName := p.monitor.DefaultInterfaceName(netip.IPv4Unspecified())
|
||||||
if p.interfaceName == newInterfaceName {
|
if p.interfaceName == newInterfaceName {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ func QUICClientHello(ctx context.Context, packet []byte) (*adapter.InboundContex
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if typeByte&0x40 == 0 {
|
||||||
if typeByte&0x80 == 0 || typeByte&0x40 == 0 {
|
|
||||||
return nil, E.New("bad type byte")
|
return nil, E.New("bad type byte")
|
||||||
}
|
}
|
||||||
var versionNumber uint32
|
var versionNumber uint32
|
||||||
@@ -145,9 +144,6 @@ func QUICClientHello(ctx context.Context, packet []byte) (*adapter.InboundContex
|
|||||||
default:
|
default:
|
||||||
return nil, E.New("bad packet number length")
|
return nil, E.New("bad packet number length")
|
||||||
}
|
}
|
||||||
if packetNumber != 0 {
|
|
||||||
return nil, E.New("bad packet number: ", packetNumber)
|
|
||||||
}
|
|
||||||
extHdrLen := hdrLen + int(packetNumberLength)
|
extHdrLen := hdrLen + int(packetNumberLength)
|
||||||
copy(newPacket[extHdrLen:hdrLen+4], packet[extHdrLen:])
|
copy(newPacket[extHdrLen:hdrLen+4], packet[extHdrLen:])
|
||||||
data := newPacket[extHdrLen : int(packetLen)+hdrLen]
|
data := newPacket[extHdrLen : int(packetLen)+hdrLen]
|
||||||
@@ -172,37 +168,76 @@ func QUICClientHello(ctx context.Context, packet []byte) (*adapter.InboundContex
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
var frameType byte
|
||||||
|
var frameLen uint64
|
||||||
|
var fragments []struct {
|
||||||
|
offset uint64
|
||||||
|
length uint64
|
||||||
|
payload []byte
|
||||||
|
}
|
||||||
decryptedReader := bytes.NewReader(decrypted)
|
decryptedReader := bytes.NewReader(decrypted)
|
||||||
frameType, err := decryptedReader.ReadByte()
|
for {
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
for frameType == 0x0 {
|
|
||||||
// skip padding
|
|
||||||
frameType, err = decryptedReader.ReadByte()
|
frameType, err = decryptedReader.ReadByte()
|
||||||
if err != nil {
|
if err == io.EOF {
|
||||||
return nil, err
|
break
|
||||||
|
}
|
||||||
|
switch frameType {
|
||||||
|
case 0x0:
|
||||||
|
continue
|
||||||
|
case 0x1:
|
||||||
|
continue
|
||||||
|
case 0x6:
|
||||||
|
var offset uint64
|
||||||
|
offset, err = qtls.ReadUvarint(decryptedReader)
|
||||||
|
if err != nil {
|
||||||
|
return &adapter.InboundContext{Protocol: C.ProtocolQUIC}, err
|
||||||
|
}
|
||||||
|
var length uint64
|
||||||
|
length, err = qtls.ReadUvarint(decryptedReader)
|
||||||
|
if err != nil {
|
||||||
|
return &adapter.InboundContext{Protocol: C.ProtocolQUIC}, err
|
||||||
|
}
|
||||||
|
index := len(decrypted) - decryptedReader.Len()
|
||||||
|
fragments = append(fragments, struct {
|
||||||
|
offset uint64
|
||||||
|
length uint64
|
||||||
|
payload []byte
|
||||||
|
}{offset, length, decrypted[index : index+int(length)]})
|
||||||
|
frameLen += length
|
||||||
|
_, err = decryptedReader.Seek(int64(length), io.SeekCurrent)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
// ignore unknown frame type
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if frameType != 0x6 {
|
|
||||||
// not crypto frame
|
|
||||||
return &adapter.InboundContext{Protocol: C.ProtocolQUIC}, nil
|
|
||||||
}
|
|
||||||
_, err = qtls.ReadUvarint(decryptedReader)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
_, err = qtls.ReadUvarint(decryptedReader)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
tlsHdr := make([]byte, 5)
|
tlsHdr := make([]byte, 5)
|
||||||
tlsHdr[0] = 0x16
|
tlsHdr[0] = 0x16
|
||||||
binary.BigEndian.PutUint16(tlsHdr[1:], uint16(0x0303))
|
binary.BigEndian.PutUint16(tlsHdr[1:], uint16(0x0303))
|
||||||
binary.BigEndian.PutUint16(tlsHdr[3:], uint16(decryptedReader.Len()))
|
binary.BigEndian.PutUint16(tlsHdr[3:], uint16(frameLen))
|
||||||
metadata, err := TLSClientHello(ctx, io.MultiReader(bytes.NewReader(tlsHdr), decryptedReader))
|
var index uint64
|
||||||
|
var length int
|
||||||
|
var readers []io.Reader
|
||||||
|
readers = append(readers, bytes.NewReader(tlsHdr))
|
||||||
|
find:
|
||||||
|
for {
|
||||||
|
for _, fragment := range fragments {
|
||||||
|
if fragment.offset == index {
|
||||||
|
readers = append(readers, bytes.NewReader(fragment.payload))
|
||||||
|
index = fragment.offset + fragment.length
|
||||||
|
length++
|
||||||
|
continue find
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length == len(fragments) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return &adapter.InboundContext{Protocol: C.ProtocolQUIC}, E.New("bad fragments")
|
||||||
|
}
|
||||||
|
metadata, err := TLSClientHello(ctx, io.MultiReader(readers...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return &adapter.InboundContext{Protocol: C.ProtocolQUIC}, err
|
||||||
}
|
}
|
||||||
metadata.Protocol = C.ProtocolQUIC
|
metadata.Protocol = C.ProtocolQUIC
|
||||||
return metadata, nil
|
return metadata, nil
|
||||||
|
|||||||
@@ -19,6 +19,15 @@ func TestSniffQUICv1(t *testing.T) {
|
|||||||
require.Equal(t, metadata.Domain, "cloudflare-quic.com")
|
require.Equal(t, metadata.Domain, "cloudflare-quic.com")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSniffQUICFragment(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
pkt, err := hex.DecodeString("cc00000001082e3d5d1b64040c55000044d0ccea69e773f6631c1d18b04ae9ee75fcfc34ef74fa62533c93534338a86f101a05d70e0697fb483063fa85db1c59ccfbda5c35234931d8524d8aac37eaaad649470a67794cd754b23c98695238b8363452333bc8c4858376b4166e001da2006e35cf98a91e11a56419b2786775284942d0f7163982f7c248867d12dd374957481dbc564013ff785e1916195eef671f725908f761099d992d69231336ba81d9e25fe2fa3a6eff4318a6ccf10176fc841a1b315f7b35c5b292266fc869d76ca533e7d14e86d82db2e22eacd350977e47d2e012d8a5891c5aaf2a0f4c2b2dae897c161e5b68cbb4dee952472bdc1e21504b8f02534ec4366ce3f8bf86efc78e0232778fbd554457567112abdcafcf6d4d8fcf35083c25d9495679614aba21696e338c62b585046cc55ba8c09c844361d889a47c3ea703b4e23545a9ab2c0bb369693a9ddfb5daffa85cf80fdd6ad66738664e5b0a551729b4955cff7255afcb04dee88c2f072c9de7400947a1bd9327ac5d012a33000ada021d4c03d249fb017d6ac9200b2f9436beab8183ddfbe2d8aee31ffb7df9e1cc181c1af80c39a89965d18ed12da8e3ebe2ae1fbe4b348f83ba19e3e3d1c9b22bcf03ab6ad9b30fe180623faa291ebad83bcd71d7b57f2f5e2f3b8e81d24fb70b2f2159239e8f21ffafef2747aba47d97ab4081e603c018b10678cf99cab1fb42156a14486fa435153979d7279fd22cd40af7088bfc7eff41af2f4b3c0c8864d0040d74dff427f7bffdb8c278474ea00311326cf4925471a8cf596cb92119f19e0f789490ba9cb77b98015a987d93e0324cf1a38b55109f00c3e6ddc5180fb107bf468323afec9bb49fd6a86418569789d66cafe3b8253c2aebb3af3782c1c54dd560487d031d28e6a6e23e159581bb1d47efc4da3fe1d169f9ffb0ca9ba61af0a38a92fde5bc5e6ec026e8378a6315a7b95abf1d2da790a391306ce74d0baf8e2ce648ca74c487f2c0a76a28a80cdf5bd34316eb607684fe7e6d9e83824a00e07660d0b90e3cddd61ebf10748263474afa88c300549e64ce2e90560bb1a12dee7e9484f729a8a4ee7c5651adb5194b3b3ae38e501567c7dbf36e7bb37a2c20b74655f47f2d9af18e52e9d4c9c9eee8e63745779b8f0b06f3a09d846ba62eb978ad77c85de1ee2fee3fbb4c2d283c73e1ccba56a4658e48a2665d200f7f9342f8e84c2ba490094a4f94feec89e42d2f654f564c2beb2997bafa1fc2c68ad8e160b63587d49abc31b834878d52acfb05fb73d0e059b206162e3c90b40c4bc08407ffcb3c08431895b691a3fea923f1f3b48db75d3e6b91fd319ffe4d486e0e14bd5c6affc838dee63d9e0b80f169b5e6c02c7321dcb20deb2b8e707b60e345a308d505bbf26a93d8f18b39d62632e9a77cbe48b3b32eb8819d6311a49820d40f5acbf0273c91c36b2269a03e72ee64df3dfb10ddefe73c64ef60870b2b77bd99dea655f5fe791b538a929a14d99f6d69685d72431ea5f0f4b27a044f2f575ab474fcc3857895934de1ca2581798eaef2c17fe5aaf2e6add97fa32997c7026f15c1b1ad0e6043ae506027a7c0242546fdc851cca39a204e56879f2cef838be8ec66e0f2292f8c862e06f810eb9b80c7a467ce6e90155206352c7f82b1173ba3b98d35bb72c259a60db20dd1a43fe6d7aef0265e6eaa5caafd9b64b448ff745a2046acbdb65cf2a5007809808a4828dc99097feedc734c236260c584")
|
||||||
|
require.NoError(t, err)
|
||||||
|
metadata, err := sniff.QUICClientHello(context.Background(), pkt)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, metadata.Domain, "cloudflare-quic.com")
|
||||||
|
}
|
||||||
|
|
||||||
func FuzzSniffQUIC(f *testing.F) {
|
func FuzzSniffQUIC(f *testing.F) {
|
||||||
f.Fuzz(func(t *testing.T, data []byte) {
|
f.Fuzz(func(t *testing.T, data []byte) {
|
||||||
sniff.QUICClientHello(context.Background(), data)
|
sniff.QUICClientHello(context.Background(), data)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
@@ -30,23 +29,25 @@ func PeekStream(ctx context.Context, conn net.Conn, buffer *buf.Buffer, sniffers
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var metadata *adapter.InboundContext
|
var metadata *adapter.InboundContext
|
||||||
|
var errors []error
|
||||||
for _, sniffer := range sniffers {
|
for _, sniffer := range sniffers {
|
||||||
metadata, err = sniffer(ctx, bytes.NewReader(buffer.Bytes()))
|
metadata, err = sniffer(ctx, bytes.NewReader(buffer.Bytes()))
|
||||||
if err != nil {
|
if metadata != nil {
|
||||||
continue
|
return metadata, nil
|
||||||
}
|
}
|
||||||
return metadata, nil
|
errors = append(errors, err)
|
||||||
}
|
}
|
||||||
return nil, os.ErrInvalid
|
return nil, E.Errors(errors...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func PeekPacket(ctx context.Context, packet []byte, sniffers ...PacketSniffer) (*adapter.InboundContext, error) {
|
func PeekPacket(ctx context.Context, packet []byte, sniffers ...PacketSniffer) (*adapter.InboundContext, error) {
|
||||||
|
var errors []error
|
||||||
for _, sniffer := range sniffers {
|
for _, sniffer := range sniffers {
|
||||||
sniffMetadata, err := sniffer(ctx, packet)
|
metadata, err := sniffer(ctx, packet)
|
||||||
if err != nil {
|
if metadata != nil {
|
||||||
continue
|
return metadata, nil
|
||||||
}
|
}
|
||||||
return sniffMetadata, nil
|
errors = append(errors, err)
|
||||||
}
|
}
|
||||||
return nil, os.ErrInvalid
|
return nil, E.Errors(errors...)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const (
|
|||||||
TypeHysteria = "hysteria"
|
TypeHysteria = "hysteria"
|
||||||
TypeTor = "tor"
|
TypeTor = "tor"
|
||||||
TypeSSH = "ssh"
|
TypeSSH = "ssh"
|
||||||
|
TypeShadowTLS = "shadowtls"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package constant
|
package constant
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Version = "1.0-beta1"
|
Version = "1.0.6"
|
||||||
Commit = ""
|
Commit = ""
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,3 +1,49 @@
|
|||||||
|
#### 1.0.1
|
||||||
|
|
||||||
|
* Fix match 4in6 address in ip_cidr
|
||||||
|
* Fix clash api log level format error
|
||||||
|
* Fix clash api unknown proxy type
|
||||||
|
|
||||||
|
#### 1.0
|
||||||
|
|
||||||
|
* Fix wireguard reconnect
|
||||||
|
* Fix naive inbound
|
||||||
|
* Fix json format error message
|
||||||
|
* Fix processing vmess termination signal
|
||||||
|
* Fix hysteria stream error
|
||||||
|
* Fix listener close when proxyproto failed
|
||||||
|
|
||||||
|
#### 1.0-rc1
|
||||||
|
|
||||||
|
* Fix write log timestamp
|
||||||
|
* Fix write zero
|
||||||
|
* Fix dial parallel in direct outbound
|
||||||
|
* Fix write trojan udp
|
||||||
|
* Fix DNS routing
|
||||||
|
* Add attribute support for geosite
|
||||||
|
* Update documentation for [Dial Fields](/configuration/shared/dial)
|
||||||
|
|
||||||
|
#### 1.0-beta3
|
||||||
|
|
||||||
|
* Add [chained inbound](/configuration/shared/listen#detour) support
|
||||||
|
* Add process_path rule item
|
||||||
|
* Add macOS redirect support
|
||||||
|
* Add ShadowTLS [Inbound](/configuration/inbound/shadowtls), [Outbound](/configuration/outbound/shadowtls)
|
||||||
|
and [Examples](/examples/shadowtls)
|
||||||
|
* Fix search android package in non-owner users
|
||||||
|
* Fix socksaddr type condition
|
||||||
|
* Fix smux session status
|
||||||
|
* Refactor inbound and outbound documentation
|
||||||
|
* Minor fixes
|
||||||
|
|
||||||
|
#### 1.0-beta2
|
||||||
|
|
||||||
|
* Add strict_route option for [Tun inbound](/configuration/inbound/tun#strict_route)
|
||||||
|
* Add packetaddr support for [VMess outbound](/configuration/outbound/vmess#packet_addr)
|
||||||
|
* Add better performing alternative gRPC implementation
|
||||||
|
* Add [docker image](https://github.com/SagerNet/sing-box/pkgs/container/sing-box)
|
||||||
|
* Fix sniff override destination
|
||||||
|
|
||||||
#### 1.0-beta1
|
#### 1.0-beta1
|
||||||
|
|
||||||
* Initial release
|
* Initial release
|
||||||
@@ -103,4 +149,4 @@
|
|||||||
|
|
||||||
No changelog before.
|
No changelog before.
|
||||||
|
|
||||||
[#9]: https://github.com/SagerNet/sing-box/pull/9
|
[#9]: https://github.com/SagerNet/sing-box/pull/9
|
||||||
|
|||||||
@@ -61,6 +61,9 @@
|
|||||||
"process_name": [
|
"process_name": [
|
||||||
"curl"
|
"curl"
|
||||||
],
|
],
|
||||||
|
"process_path": [
|
||||||
|
"/usr/bin/curl"
|
||||||
|
],
|
||||||
"package_name": [
|
"package_name": [
|
||||||
"com.termux"
|
"com.termux"
|
||||||
],
|
],
|
||||||
@@ -177,6 +180,14 @@ Match port range.
|
|||||||
|
|
||||||
Match process name.
|
Match process name.
|
||||||
|
|
||||||
|
#### process_path
|
||||||
|
|
||||||
|
!!! error ""
|
||||||
|
|
||||||
|
Only supported on Linux, Windows, and macOS.
|
||||||
|
|
||||||
|
Match process path.
|
||||||
|
|
||||||
#### package_name
|
#### package_name
|
||||||
|
|
||||||
Match android package name.
|
Match android package name.
|
||||||
|
|||||||
@@ -60,6 +60,9 @@
|
|||||||
"process_name": [
|
"process_name": [
|
||||||
"curl"
|
"curl"
|
||||||
],
|
],
|
||||||
|
"process_path": [
|
||||||
|
"/usr/bin/curl"
|
||||||
|
],
|
||||||
"package_name": [
|
"package_name": [
|
||||||
"com.termux"
|
"com.termux"
|
||||||
],
|
],
|
||||||
@@ -176,6 +179,14 @@
|
|||||||
|
|
||||||
匹配进程名称。
|
匹配进程名称。
|
||||||
|
|
||||||
|
#### process_path
|
||||||
|
|
||||||
|
!!! error ""
|
||||||
|
|
||||||
|
仅支持 Linux、Windows 和 macOS.
|
||||||
|
|
||||||
|
匹配进程路径。
|
||||||
|
|
||||||
#### package_name
|
#### package_name
|
||||||
|
|
||||||
匹配 Android 应用包名。
|
匹配 Android 应用包名。
|
||||||
|
|||||||
@@ -4,29 +4,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "direct",
|
||||||
{
|
"tag": "direct-in",
|
||||||
"type": "direct",
|
|
||||||
"tag": "direct-in",
|
... // Listen Fields
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 5353,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"udp_timeout": 300,
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"network": "udp",
|
"network": "udp",
|
||||||
"override_address": "1.0.0.1",
|
"override_address": "1.0.0.1",
|
||||||
"override_port": 53
|
"override_port": 53
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Direct Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
@@ -40,50 +33,4 @@ Override the connection destination address.
|
|||||||
|
|
||||||
#### override_port
|
#### override_port
|
||||||
|
|
||||||
Override the connection destination port.
|
Override the connection destination port.
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
Enable tcp fast open for listener.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|
||||||
#### udp_timeout
|
|
||||||
|
|
||||||
UDP NAT expiration time in seconds, default is 300 (5 minutes).
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
|
|
||||||
@@ -4,29 +4,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "direct",
|
||||||
{
|
"tag": "direct-in",
|
||||||
"type": "direct",
|
|
||||||
"tag": "direct-in",
|
|
||||||
|
|
||||||
"listen": "::",
|
... // 监听字段
|
||||||
"listen_port": 5353,
|
|
||||||
"tcp_fast_open": false,
|
"network": "udp",
|
||||||
"sniff": false,
|
"override_address": "1.0.0.1",
|
||||||
"sniff_override_destination": false,
|
"override_port": 53
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"udp_timeout": 300,
|
|
||||||
|
|
||||||
"network": "udp",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
"override_address": "1.0.0.1",
|
|
||||||
"override_port": 53
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Direct 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
@@ -42,48 +35,3 @@
|
|||||||
|
|
||||||
覆盖连接目标端口。
|
覆盖连接目标端口。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### udp_timeout
|
|
||||||
|
|
||||||
UDP NAT 过期时间,以秒为单位,默认为 300(5 分钟)。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
|
|||||||
@@ -2,33 +2,27 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "http",
|
||||||
|
"tag": "http-in",
|
||||||
|
|
||||||
|
... // Listen Fields
|
||||||
|
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "http",
|
"username": "admin",
|
||||||
"tag": "http-in",
|
"password": "admin"
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"username": "admin",
|
|
||||||
"password": "admin"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"tls": {},
|
|
||||||
"set_system_proxy": false
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {},
|
||||||
|
"set_system_proxy": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### HTTP Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### tls
|
#### tls
|
||||||
|
|
||||||
@@ -47,45 +41,3 @@ No authentication required if empty.
|
|||||||
Only supported on Linux, Android, Windows, and macOS.
|
Only supported on Linux, Android, Windows, and macOS.
|
||||||
|
|
||||||
Automatically set system proxy configuration when start and clean up when stop.
|
Automatically set system proxy configuration when start and clean up when stop.
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
Enable tcp fast open for listener.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
|
|
||||||
@@ -2,33 +2,27 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "http",
|
||||||
|
"tag": "http-in",
|
||||||
|
|
||||||
|
... // 监听字段
|
||||||
|
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "http",
|
"username": "admin",
|
||||||
"tag": "http-in",
|
"password": "admin"
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"username": "admin",
|
|
||||||
"password": "admin"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"tls": {},
|
|
||||||
"set_system_proxy": false
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {},
|
||||||
|
"set_system_proxy": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### HTTP 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### tls
|
#### tls
|
||||||
|
|
||||||
@@ -38,7 +32,7 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|||||||
|
|
||||||
HTTP 用户
|
HTTP 用户
|
||||||
|
|
||||||
默认不需要验证。
|
如果为空则不需要验证。
|
||||||
|
|
||||||
#### set_system_proxy
|
#### set_system_proxy
|
||||||
|
|
||||||
@@ -46,46 +40,4 @@ HTTP 用户
|
|||||||
|
|
||||||
仅支持 Linux、Android、Windows 和 macOS。
|
仅支持 Linux、Android、Windows 和 macOS。
|
||||||
|
|
||||||
启动时自动设置系统代理,停止时自动清理。
|
启动时自动设置系统代理,停止时自动清理。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
@@ -2,31 +2,23 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "hysteria",
|
||||||
{
|
"tag": "hysteria-in",
|
||||||
"type": "hysteria",
|
|
||||||
"tag": "hysteria-in",
|
... // Listen Fields
|
||||||
|
|
||||||
"listen": "::",
|
"up": "100 Mbps",
|
||||||
"listen_port": 443,
|
"up_mbps": 100,
|
||||||
"sniff": false,
|
"down": "100 Mbps",
|
||||||
"sniff_override_destination": false,
|
"down_mbps": 100,
|
||||||
"domain_strategy": "prefer_ipv6",
|
"obfs": "fuck me till the daylight",
|
||||||
|
"auth": "",
|
||||||
"up": "100 Mbps",
|
"auth_str": "password",
|
||||||
"up_mbps": 100,
|
"recv_window_conn": 0,
|
||||||
"down": "100 Mbps",
|
"recv_window_client": 0,
|
||||||
"down_mbps": 100,
|
"max_conn_client": 0,
|
||||||
"obfs": "fuck me till the daylight",
|
"disable_mtu_discovery": false,
|
||||||
"auth": "",
|
"tls": {}
|
||||||
"auth_str": "password",
|
|
||||||
"recv_window_conn": 0,
|
|
||||||
"recv_window_client": 0,
|
|
||||||
"max_conn_client": 0,
|
|
||||||
"disable_mtu_discovery": false,
|
|
||||||
"tls": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -34,7 +26,11 @@
|
|||||||
|
|
||||||
QUIC, which is required by hysteria is not included by default, see [Installation](/#installation).
|
QUIC, which is required by hysteria is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
### Hysteria Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### up, down
|
#### up, down
|
||||||
|
|
||||||
@@ -101,38 +97,4 @@ Force enabled on for systems other than Linux and Windows (according to upstream
|
|||||||
|
|
||||||
==Required==
|
==Required==
|
||||||
|
|
||||||
TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
|
TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
@@ -2,31 +2,23 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "hysteria",
|
||||||
{
|
"tag": "hysteria-in",
|
||||||
"type": "hysteria",
|
|
||||||
"tag": "hysteria-in",
|
... // 监听字段
|
||||||
|
|
||||||
"listen": "::",
|
"up": "100 Mbps",
|
||||||
"listen_port": 443,
|
"up_mbps": 100,
|
||||||
"sniff": false,
|
"down": "100 Mbps",
|
||||||
"sniff_override_destination": false,
|
"down_mbps": 100,
|
||||||
"domain_strategy": "prefer_ipv6",
|
"obfs": "fuck me till the daylight",
|
||||||
|
"auth": "",
|
||||||
"up": "100 Mbps",
|
"auth_str": "password",
|
||||||
"up_mbps": 100,
|
"recv_window_conn": 0,
|
||||||
"down": "100 Mbps",
|
"recv_window_client": 0,
|
||||||
"down_mbps": 100,
|
"max_conn_client": 0,
|
||||||
"obfs": "fuck me till the daylight",
|
"disable_mtu_discovery": false,
|
||||||
"auth": "",
|
"tls": {}
|
||||||
"auth_str": "password",
|
|
||||||
"recv_window_conn": 0,
|
|
||||||
"recv_window_client": 0,
|
|
||||||
"max_conn_client": 0,
|
|
||||||
"disable_mtu_discovery": false,
|
|
||||||
"tls": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -34,7 +26,11 @@
|
|||||||
|
|
||||||
默认安装不包含被 Hysteria 依赖的 QUIC,参阅 [安装](/zh/#_2)。
|
默认安装不包含被 Hysteria 依赖的 QUIC,参阅 [安装](/zh/#_2)。
|
||||||
|
|
||||||
### Hysteria 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### up, down
|
#### up, down
|
||||||
|
|
||||||
@@ -101,38 +97,4 @@ base64 编码的认证密码。
|
|||||||
|
|
||||||
==必填==
|
==必填==
|
||||||
|
|
||||||
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
@@ -15,20 +15,20 @@
|
|||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
| Type | Format |
|
| Type | Format | Injectable |
|
||||||
|---------------|------------------------------|
|
|---------------|------------------------------|------------|
|
||||||
| `direct` | [Direct](./direct) |
|
| `direct` | [Direct](./direct) | X |
|
||||||
| `mixed` | [Mixed](./mixed) |
|
| `mixed` | [Mixed](./mixed) | TCP |
|
||||||
| `socks` | [SOCKS](./socks) |
|
| `socks` | [SOCKS](./socks) | TCP |
|
||||||
| `http` | [HTTP](./http) |
|
| `http` | [HTTP](./http) | TCP |
|
||||||
| `shadowsocks` | [Shadowsocks](./shadowsocks) |
|
| `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
|
||||||
| `vmess` | [VMess](./vmess) |
|
| `vmess` | [VMess](./vmess) | TCP |
|
||||||
| `trojan` | [Trojan](./trojan) |
|
| `trojan` | [Trojan](./trojan) | TCP |
|
||||||
| `naive` | [Naive](./naive) |
|
| `naive` | [Naive](./naive) | X |
|
||||||
| `hysteria` | [Hysteria](./hysteria) |
|
| `hysteria` | [Hysteria](./hysteria) | X |
|
||||||
| `tun` | [Tun](./tun) |
|
| `tun` | [Tun](./tun) | X |
|
||||||
| `redirect` | [Redirect](./redirect) |
|
| `redirect` | [Redirect](./redirect) | X |
|
||||||
| `tproxy` | [TProxy](./tproxy) |
|
| `tproxy` | [TProxy](./tproxy) | X |
|
||||||
|
|
||||||
#### tag
|
#### tag
|
||||||
|
|
||||||
|
|||||||
@@ -15,20 +15,20 @@
|
|||||||
|
|
||||||
### 字段
|
### 字段
|
||||||
|
|
||||||
| 类型 | 格式 |
|
| 类型 | 格式 | 注入支持 |
|
||||||
|---------------|------------------------------|
|
|---------------|------------------------------|------|
|
||||||
| `direct` | [Direct](./direct) |
|
| `direct` | [Direct](./direct) | X |
|
||||||
| `mixed` | [Mixed](./mixed) |
|
| `mixed` | [Mixed](./mixed) | TCP |
|
||||||
| `socks` | [SOCKS](./socks) |
|
| `socks` | [SOCKS](./socks) | TCP |
|
||||||
| `http` | [HTTP](./http) |
|
| `http` | [HTTP](./http) | TCP |
|
||||||
| `shadowsocks` | [Shadowsocks](./shadowsocks) |
|
| `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
|
||||||
| `vmess` | [VMess](./vmess) |
|
| `vmess` | [VMess](./vmess) | TCP |
|
||||||
| `trojan` | [Trojan](./trojan) |
|
| `trojan` | [Trojan](./trojan) | TCP |
|
||||||
| `naive` | [Naive](./naive) |
|
| `naive` | [Naive](./naive) | X |
|
||||||
| `hysteria` | [Hysteria](./hysteria) |
|
| `hysteria` | [Hysteria](./hysteria) | X |
|
||||||
| `tun` | [Tun](./tun) |
|
| `tun` | [Tun](./tun) | X |
|
||||||
| `redirect` | [Redirect](./redirect) |
|
| `redirect` | [Redirect](./redirect) | X |
|
||||||
| `tproxy` | [TProxy](./tproxy) |
|
| `tproxy` | [TProxy](./tproxy) | X |
|
||||||
|
|
||||||
#### tag
|
#### tag
|
||||||
|
|
||||||
|
|||||||
@@ -4,32 +4,26 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "mixed",
|
||||||
|
"tag": "mixed-in",
|
||||||
|
|
||||||
|
... // Listen Fields
|
||||||
|
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "mixed",
|
"username": "admin",
|
||||||
"tag": "mixed-in",
|
"password": "admin"
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"username": "admin",
|
|
||||||
"password": "admin"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"set_system_proxy": false
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"set_system_proxy": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mixed Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
@@ -39,52 +33,6 @@ No authentication required if empty.
|
|||||||
|
|
||||||
#### set_system_proxy
|
#### set_system_proxy
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux, Android, Windows, and macOS.
|
|
||||||
|
|
||||||
Automatically set system proxy configuration when start and clean up when stop.
|
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
Enable tcp fast open for listener.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|
||||||
#### set_system_proxy
|
|
||||||
|
|
||||||
!!! error ""
|
!!! error ""
|
||||||
|
|
||||||
Only supported on Linux, Android, Windows, and macOS.
|
Only supported on Linux, Android, Windows, and macOS.
|
||||||
|
|||||||
@@ -4,38 +4,32 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "mixed",
|
||||||
|
"tag": "mixed-in",
|
||||||
|
|
||||||
|
... // 监听字段
|
||||||
|
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "mixed",
|
"username": "admin",
|
||||||
"tag": "mixed-in",
|
"password": "admin"
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"username": "admin",
|
|
||||||
"password": "admin"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"set_system_proxy": false
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"set_system_proxy": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mixed 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
SOCKS 和 HTTP 用户
|
SOCKS 和 HTTP 用户
|
||||||
|
|
||||||
默认不需要验证。
|
如果为空则不需要验证。
|
||||||
|
|
||||||
#### set_system_proxy
|
#### set_system_proxy
|
||||||
|
|
||||||
@@ -43,46 +37,4 @@ SOCKS 和 HTTP 用户
|
|||||||
|
|
||||||
仅支持 Linux、Android、Windows 和 macOS。
|
仅支持 Linux、Android、Windows 和 macOS。
|
||||||
|
|
||||||
启动时自动设置系统代理,停止时自动清理。
|
启动时自动设置系统代理,停止时自动清理。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
@@ -2,29 +2,19 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "naive",
|
||||||
|
"tag": "naive-in",
|
||||||
|
"network": "udp",
|
||||||
|
|
||||||
|
... // Listen Fields
|
||||||
|
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "naive",
|
"username": "sekai",
|
||||||
"tag": "naive-in",
|
"password": "password"
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 443,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"network": "udp",
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"username": "sekai",
|
|
||||||
"password": "password"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"tls": {}
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -32,7 +22,11 @@
|
|||||||
|
|
||||||
HTTP3 transport is not included by default, see [Installation](/#installation).
|
HTTP3 transport is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
### Naive Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
@@ -48,46 +42,4 @@ Naive users.
|
|||||||
|
|
||||||
#### tls
|
#### tls
|
||||||
|
|
||||||
TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
|
TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
Enable tcp fast open for listener.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
|
|
||||||
@@ -2,29 +2,19 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "naive",
|
||||||
{
|
"tag": "naive-in",
|
||||||
"type": "naive",
|
"network": "udp",
|
||||||
"tag": "naive-in",
|
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 443,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"network": "udp",
|
... // 监听字段
|
||||||
"users": [
|
|
||||||
{
|
"users": [
|
||||||
"username": "sekai",
|
{
|
||||||
"password": "password"
|
"username": "sekai",
|
||||||
}
|
"password": "password"
|
||||||
],
|
|
||||||
"tls": {}
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -32,7 +22,11 @@
|
|||||||
|
|
||||||
默认安装不包含 HTTP3 传输层, 参阅 [安装](/zh/#_2)。
|
默认安装不包含 HTTP3 传输层, 参阅 [安装](/zh/#_2)。
|
||||||
|
|
||||||
### Naive 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
@@ -48,46 +42,4 @@ Naive 用户。
|
|||||||
|
|
||||||
#### tls
|
#### tls
|
||||||
|
|
||||||
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
@@ -1,52 +1,18 @@
|
|||||||
|
!!! error ""
|
||||||
|
|
||||||
|
Only supported on Linux and macOS.
|
||||||
|
|
||||||
### Structure
|
### Structure
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "redirect",
|
||||||
{
|
"tag": "redirect-in",
|
||||||
"type": "redirect",
|
|
||||||
"tag": "redirect-in",
|
... // Listen Fields
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 5353,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
#### listen
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|||||||
@@ -1,52 +1,17 @@
|
|||||||
|
!!! error ""
|
||||||
|
|
||||||
|
仅支持 Linux 和 macOS。
|
||||||
|
|
||||||
### 结构
|
### 结构
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "redirect",
|
||||||
{
|
"tag": "redirect-in",
|
||||||
"type": "redirect",
|
|
||||||
"tag": "redirect-in",
|
... // 监听字段
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 5353,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 监听字段
|
### 监听字段
|
||||||
|
|
||||||
#### listen
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|||||||
@@ -2,25 +2,13 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "shadowsocks",
|
||||||
{
|
"tag": "ss-in",
|
||||||
"type": "shadowsocks",
|
|
||||||
"tag": "ss-in",
|
... // Listen Fields
|
||||||
|
|
||||||
"listen": "::",
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
"listen_port": 5353,
|
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"udp_timeout": 300,
|
|
||||||
"network": "udp",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -28,17 +16,12 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "shadowsocks",
|
"name": "sekai",
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"name": "sekai",
|
|
||||||
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -48,25 +31,25 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "shadowsocks",
|
||||||
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
|
"destinations": [
|
||||||
{
|
{
|
||||||
"type": "shadowsocks",
|
"name": "test",
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"server": "example.com",
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
"server_port": 8080,
|
||||||
"destinations": [
|
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
||||||
{
|
|
||||||
"name": "test",
|
|
||||||
"server": "example.com",
|
|
||||||
"server_port": 8080,
|
|
||||||
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shadowsocks Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
|
|||||||
@@ -2,25 +2,13 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "shadowsocks",
|
||||||
{
|
"tag": "ss-in",
|
||||||
"type": "shadowsocks",
|
|
||||||
"tag": "ss-in",
|
... // 监听字段
|
||||||
|
|
||||||
"listen": "::",
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
"listen_port": 5353,
|
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"udp_timeout": 300,
|
|
||||||
"network": "udp",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -28,17 +16,12 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "shadowsocks",
|
"name": "sekai",
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"name": "sekai",
|
|
||||||
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -48,25 +31,25 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "shadowsocks",
|
||||||
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
|
"destinations": [
|
||||||
{
|
{
|
||||||
"type": "shadowsocks",
|
"name": "test",
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"server": "example.com",
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
"server_port": 8080,
|
||||||
"destinations": [
|
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
||||||
{
|
|
||||||
"name": "test",
|
|
||||||
"server": "example.com",
|
|
||||||
"server_port": 8080,
|
|
||||||
"password": "PCD2Z4o12bKUoFa3cC97Hw=="
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shadowsocks 字段
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
@@ -98,50 +81,4 @@
|
|||||||
|---------------|-------------------------------|
|
|---------------|-------------------------------|
|
||||||
| none | / |
|
| none | / |
|
||||||
| 2022 methods | `openssl rand -base64 <密钥长度>` |
|
| 2022 methods | `openssl rand -base64 <密钥长度>` |
|
||||||
| other methods | 任意字符串 |
|
| other methods | 任意字符串 |
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### udp_timeout
|
|
||||||
|
|
||||||
UDP NAT 过期时间,以秒为单位,默认为 300(5 分钟)。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
31
docs/configuration/inbound/shadowtls.md
Normal file
31
docs/configuration/inbound/shadowtls.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
### Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "shadowtls",
|
||||||
|
"tag": "st-in",
|
||||||
|
|
||||||
|
... // Listen Fields
|
||||||
|
|
||||||
|
"handshake": {
|
||||||
|
"server": "google.com",
|
||||||
|
"server_port": 443,
|
||||||
|
|
||||||
|
... // Dial Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
|
#### handshake
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
Handshake server address and [dial options](/configuration/shared/dial).
|
||||||
|
|
||||||
29
docs/configuration/inbound/shadowtls.zh.md
Normal file
29
docs/configuration/inbound/shadowtls.zh.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
### 结构
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "shadowtls",
|
||||||
|
"tag": "st-in",
|
||||||
|
|
||||||
|
... // 监听字段
|
||||||
|
|
||||||
|
"handshake": {
|
||||||
|
"server": "google.com",
|
||||||
|
"server_port": 443,
|
||||||
|
|
||||||
|
... // 拨号字段
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
|
#### handshake
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
握手服务器地址和 [拨号参数](/zh/configuration/shared/dial/)。
|
||||||
@@ -4,76 +4,28 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "socks",
|
||||||
{
|
"tag": "socks-in",
|
||||||
"type": "socks",
|
|
||||||
"tag": "socks-in",
|
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
... // Listen Fields
|
||||||
{
|
|
||||||
"username": "admin",
|
"users": [
|
||||||
"password": "admin"
|
{
|
||||||
}
|
"username": "admin",
|
||||||
]
|
"password": "admin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### SOCKS Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
SOCKS users.
|
SOCKS users.
|
||||||
|
|
||||||
No authentication required if empty.
|
No authentication required if empty.
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
|
|||||||
@@ -4,76 +4,28 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "socks",
|
||||||
{
|
"tag": "socks-in",
|
||||||
"type": "socks",
|
|
||||||
"tag": "socks-in",
|
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
... // 监听字段
|
||||||
{
|
|
||||||
"username": "admin",
|
"users": [
|
||||||
"password": "admin"
|
{
|
||||||
}
|
"username": "admin",
|
||||||
]
|
"password": "admin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### SOCKS 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
SOCKS 用户
|
SOCKS 用户
|
||||||
|
|
||||||
默认不需要验证。
|
如果为空则不需要验证。
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
|
|||||||
@@ -1,67 +1,28 @@
|
|||||||
|
!!! error ""
|
||||||
|
|
||||||
|
Only supported on Linux.
|
||||||
|
|
||||||
### Structure
|
### Structure
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "tproxy",
|
||||||
{
|
"tag": "tproxy-in",
|
||||||
"type": "tproxy",
|
|
||||||
"tag": "tproxy-in",
|
... // Listen Fields
|
||||||
|
|
||||||
"listen": "::",
|
"network": "udp"
|
||||||
"listen_port": 5353,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"udp_timeout": 300,
|
|
||||||
|
|
||||||
"network": "udp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### TProxy Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
Listen network, one of `tcp` `udp`.
|
Listen network, one of `tcp` `udp`.
|
||||||
|
|
||||||
Both if empty.
|
Both if empty.
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|
||||||
#### udp_timeout
|
|
||||||
|
|
||||||
UDP NAT expiration time in seconds, default is 300 (5 minutes).
|
|
||||||
|
|||||||
@@ -1,67 +1,28 @@
|
|||||||
|
!!! error ""
|
||||||
|
|
||||||
|
仅支持 Linux。
|
||||||
|
|
||||||
### 结构
|
### 结构
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "tproxy",
|
||||||
{
|
"tag": "tproxy-in",
|
||||||
"type": "tproxy",
|
|
||||||
"tag": "tproxy-in",
|
... // 监听字段
|
||||||
|
|
||||||
"listen": "::",
|
"network": "udp"
|
||||||
"listen_port": 5353,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"udp_timeout": 300,
|
|
||||||
|
|
||||||
"network": "udp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### TProxy 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
监听的网络协议,`tcp` `udp` 之一。
|
监听的网络协议,`tcp` `udp` 之一。
|
||||||
|
|
||||||
默认所有。
|
默认所有。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### udp_timeout
|
|
||||||
|
|
||||||
UDP NAT 过期时间,以秒为单位,默认为 300(5 分钟)。
|
|
||||||
@@ -2,43 +2,37 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "trojan",
|
||||||
{
|
"tag": "trojan-in",
|
||||||
"type": "trojan",
|
|
||||||
"tag": "trojan-in",
|
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
... // Listen Fields
|
||||||
{
|
|
||||||
"name": "sekai",
|
"users": [
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
{
|
||||||
}
|
"name": "sekai",
|
||||||
],
|
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
||||||
"tls": {},
|
|
||||||
"fallback": {
|
|
||||||
"server": "127.0.0.1",
|
|
||||||
"server_port": 8080
|
|
||||||
},
|
|
||||||
"fallback_for_alpn": {
|
|
||||||
"http/1.1": {
|
|
||||||
"server": "127.0.0.1",
|
|
||||||
"server_port": 8081
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"transport": {}
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {},
|
||||||
|
"fallback": {
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 8080
|
||||||
|
},
|
||||||
|
"fallback_for_alpn": {
|
||||||
|
"http/1.1": {
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 8081
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"transport": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Trojan Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
@@ -67,45 +61,3 @@ If not empty, TLS fallback requests with ALPN not in this table will be rejected
|
|||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
Enable tcp fast open for listener.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
|
|
||||||
@@ -2,41 +2,37 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "trojan",
|
||||||
|
"tag": "trojan-in",
|
||||||
|
|
||||||
|
... // 监听字段
|
||||||
|
|
||||||
|
"users": [
|
||||||
{
|
{
|
||||||
"type": "trojan",
|
"name": "sekai",
|
||||||
"tag": "trojan-in",
|
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"name": "sekai",
|
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"tls": {},
|
|
||||||
"fallback": {
|
|
||||||
"server": "127.0.0.1",
|
|
||||||
"server_port": 8080
|
|
||||||
},
|
|
||||||
"fallback_for_alpn": {
|
|
||||||
"http/1.1": {
|
|
||||||
"server": "127.0.0.1",
|
|
||||||
"server_port": 8081
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"transport": {}
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {},
|
||||||
|
"fallback": {
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 8080
|
||||||
|
},
|
||||||
|
"fallback_for_alpn": {
|
||||||
|
"http/1.1": {
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 8081
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"transport": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Trojan 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
@@ -54,7 +50,7 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|||||||
|
|
||||||
!!! error ""
|
!!! error ""
|
||||||
|
|
||||||
没有证据表明 GFW 基于 HTTP 响应检测并阻止木马服务器,并且在服务器上打开标准 http/s 端口是一个更大的特征。
|
没有证据表明 GFW 基于 HTTP 响应检测并阻止 Trojan 服务器,并且在服务器上打开标准 http/s 端口是一个更大的特征。
|
||||||
|
|
||||||
回退服务器配置。如果 `fallback` 和 `fallback_for_alpn` 为空,则禁用回退。
|
回退服务器配置。如果 `fallback` 和 `fallback_for_alpn` 为空,则禁用回退。
|
||||||
|
|
||||||
@@ -66,46 +62,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
@@ -6,47 +6,41 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "tun",
|
||||||
{
|
"tag": "tun-in",
|
||||||
"type": "tun",
|
|
||||||
"tag": "tun-in",
|
"interface_name": "tun0",
|
||||||
"interface_name": "tun0",
|
"inet4_address": "172.19.0.1/30",
|
||||||
"inet4_address": "172.19.0.1/30",
|
"inet6_address": "fdfe:dcba:9876::1/128",
|
||||||
"inet6_address": "fdfe:dcba:9876::1/128",
|
"mtu": 1500,
|
||||||
"mtu": 1500,
|
"auto_route": true,
|
||||||
"auto_route": true,
|
"strict_route": true,
|
||||||
"endpoint_independent_nat": false,
|
"endpoint_independent_nat": false,
|
||||||
"udp_timeout": 300,
|
"stack": "gvisor",
|
||||||
"stack": "gvisor",
|
"include_uid": [
|
||||||
"include_uid": [
|
0
|
||||||
0
|
],
|
||||||
],
|
"include_uid_range": [
|
||||||
"include_uid_range": [
|
"1000-99999"
|
||||||
[
|
],
|
||||||
"1000-99999"
|
"exclude_uid": [
|
||||||
]
|
1000
|
||||||
],
|
],
|
||||||
"exclude_uid": [
|
"exclude_uid_range": [
|
||||||
1000
|
"1000-99999"
|
||||||
],
|
],
|
||||||
"exclude_uid_range": [
|
"include_android_user": [
|
||||||
"1000-99999"
|
0,
|
||||||
],
|
10
|
||||||
"include_android_user": [
|
],
|
||||||
0,
|
"include_package": [
|
||||||
10
|
"com.android.chrome"
|
||||||
],
|
],
|
||||||
"include_package": [
|
"exclude_package": [
|
||||||
"com.android.chrome"
|
"com.android.captiveportallogin"
|
||||||
],
|
],
|
||||||
"exclude_package": [
|
|
||||||
"com.android.captiveportallogin"
|
... // Listen Fields
|
||||||
],
|
|
||||||
"sniff": true,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv4"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -58,7 +52,7 @@
|
|||||||
|
|
||||||
If tun is running in non-privileged mode, addresses and MTU will not be configured automatically, please make sure the settings are accurate.
|
If tun is running in non-privileged mode, addresses and MTU will not be configured automatically, please make sure the settings are accurate.
|
||||||
|
|
||||||
### Tun Fields
|
### Fields
|
||||||
|
|
||||||
#### interface_name
|
#### interface_name
|
||||||
|
|
||||||
@@ -86,6 +80,16 @@ Set the default route to the Tun.
|
|||||||
|
|
||||||
To avoid traffic loopback, set `route.auto_detect_interface` or `route.default_interface` or `outbound.bind_interface`
|
To avoid traffic loopback, set `route.auto_detect_interface` or `route.default_interface` or `outbound.bind_interface`
|
||||||
|
|
||||||
|
#### strict_route
|
||||||
|
|
||||||
|
Enforce strict routing rules in Linux when `auto_route` is enabled:
|
||||||
|
|
||||||
|
* Let unsupported network unreachable
|
||||||
|
* Route all connections to tun
|
||||||
|
|
||||||
|
It prevents address leaks and makes DNS hijacking work on Android and Linux with systemd-resolved, but your device will
|
||||||
|
not be accessible by others.
|
||||||
|
|
||||||
#### endpoint_independent_nat
|
#### endpoint_independent_nat
|
||||||
|
|
||||||
Enable endpoint-independent NAT.
|
Enable endpoint-independent NAT.
|
||||||
@@ -152,22 +156,4 @@ Exclude android packages in route.
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
#### sniff
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|||||||
@@ -6,47 +6,41 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "tun",
|
||||||
{
|
"tag": "tun-in",
|
||||||
"type": "tun",
|
|
||||||
"tag": "tun-in",
|
"interface_name": "tun0",
|
||||||
"interface_name": "tun0",
|
"inet4_address": "172.19.0.1/30",
|
||||||
"inet4_address": "172.19.0.1/30",
|
"inet6_address": "fdfe:dcba:9876::1/128",
|
||||||
"inet6_address": "fdfe:dcba:9876::1/128",
|
"mtu": 1500,
|
||||||
"mtu": 1500,
|
"auto_route": true,
|
||||||
"auto_route": true,
|
"strict_route": true,
|
||||||
"endpoint_independent_nat": false,
|
"endpoint_independent_nat": false,
|
||||||
"udp_timeout": 300,
|
"stack": "gvisor",
|
||||||
"stack": "gvisor",
|
"include_uid": [
|
||||||
"include_uid": [
|
0
|
||||||
0
|
],
|
||||||
],
|
"include_uid_range": [
|
||||||
"include_uid_range": [
|
"1000-99999"
|
||||||
[
|
],
|
||||||
"1000-99999"
|
"exclude_uid": [
|
||||||
]
|
1000
|
||||||
],
|
],
|
||||||
"exclude_uid": [
|
"exclude_uid_range": [
|
||||||
1000
|
"1000-99999"
|
||||||
],
|
],
|
||||||
"exclude_uid_range": [
|
"include_android_user": [
|
||||||
"1000-99999"
|
0,
|
||||||
],
|
10
|
||||||
"include_android_user": [
|
],
|
||||||
0,
|
"include_package": [
|
||||||
10
|
"com.android.chrome"
|
||||||
],
|
],
|
||||||
"include_package": [
|
"exclude_package": [
|
||||||
"com.android.chrome"
|
"com.android.captiveportallogin"
|
||||||
],
|
],
|
||||||
"exclude_package": [
|
|
||||||
"com.android.captiveportallogin"
|
... // 监听字段
|
||||||
],
|
|
||||||
"sniff": true,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv4"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -86,6 +80,15 @@ tun 接口的 IPv6 前缀。
|
|||||||
|
|
||||||
为避免流量环回,请设置 `route.auto_detect_interface` 或 `route.default_interface` 或 `outbound.bind_interface`。
|
为避免流量环回,请设置 `route.auto_detect_interface` 或 `route.default_interface` 或 `outbound.bind_interface`。
|
||||||
|
|
||||||
|
#### strict_route
|
||||||
|
|
||||||
|
在 Linux 中启用 `auto_route` 时执行严格的路由规则。
|
||||||
|
|
||||||
|
* 让不支持的网络无法到达
|
||||||
|
* 将所有连接路由到 tun
|
||||||
|
|
||||||
|
它可以防止地址泄漏,并使 DNS 劫持在 Android 和使用 systemd-resolved 的 Linux 上工作,但你的设备将无法其他设备被访问。
|
||||||
|
|
||||||
#### endpoint_independent_nat
|
#### endpoint_independent_nat
|
||||||
|
|
||||||
启用独立于端点的 NAT。
|
启用独立于端点的 NAT。
|
||||||
@@ -152,22 +155,4 @@ TCP/IP 栈。
|
|||||||
|
|
||||||
### 监听字段
|
### 监听字段
|
||||||
|
|
||||||
#### sniff
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
@@ -2,34 +2,28 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "vmess",
|
||||||
{
|
"tag": "vmess-in",
|
||||||
"type": "vmess",
|
|
||||||
"tag": "vmess-in",
|
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
... // Listen Fields
|
||||||
{
|
|
||||||
"name": "sekai",
|
"users": [
|
||||||
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
{
|
||||||
"alterId": 0
|
"name": "sekai",
|
||||||
}
|
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
||||||
],
|
"alterId": 0
|
||||||
"tls": {},
|
|
||||||
"transport": {}
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {},
|
||||||
|
"transport": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### VMess Fields
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
@@ -53,45 +47,3 @@ TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
|
|||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
||||||
|
|
||||||
### Listen Fields
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen address.
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
Listen port.
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
Enable tcp fast open for listener.
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
Enable sniffing.
|
|
||||||
|
|
||||||
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
Override the connection destination address with the sniffed domain.
|
|
||||||
|
|
||||||
If the domain name is invalid (like tor), this will not work.
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before routing.
|
|
||||||
|
|
||||||
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
|
|
||||||
@@ -2,34 +2,28 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"inbounds": [
|
"type": "vmess",
|
||||||
{
|
"tag": "vmess-in",
|
||||||
"type": "vmess",
|
|
||||||
"tag": "vmess-in",
|
|
||||||
|
|
||||||
"listen": "::",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"sniff": false,
|
|
||||||
"sniff_override_destination": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"proxy_protocol": false,
|
|
||||||
|
|
||||||
"users": [
|
... // 监听字段
|
||||||
{
|
|
||||||
"name": "sekai",
|
"users": [
|
||||||
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
{
|
||||||
"alterId": 0
|
"name": "sekai",
|
||||||
}
|
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
||||||
],
|
"alterId": 0
|
||||||
"tls": {},
|
|
||||||
"transport": {}
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"tls": {},
|
||||||
|
"transport": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### VMess 字段
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
#### users
|
#### users
|
||||||
|
|
||||||
@@ -53,45 +47,3 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
||||||
|
|
||||||
### 监听字段
|
|
||||||
|
|
||||||
#### listen
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听地址。
|
|
||||||
|
|
||||||
#### listen_port
|
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
监听端口。
|
|
||||||
|
|
||||||
#### tcp_fast_open
|
|
||||||
|
|
||||||
为监听器启用 TCP 快速打开。
|
|
||||||
|
|
||||||
#### sniff
|
|
||||||
|
|
||||||
启用协议探测。
|
|
||||||
|
|
||||||
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
|
||||||
|
|
||||||
#### sniff_override_destination
|
|
||||||
|
|
||||||
用探测出的域名覆盖连接目标地址。
|
|
||||||
|
|
||||||
如果域名无效(如 Tor),将不生效。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,请求的域名将在路由之前解析为 IP。
|
|
||||||
|
|
||||||
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
||||||
|
|
||||||
#### proxy_protocol
|
|
||||||
|
|
||||||
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ sing-box uses JSON for configuration files.
|
|||||||
{
|
{
|
||||||
"log": {},
|
"log": {},
|
||||||
"dns": {},
|
"dns": {},
|
||||||
"inbounds": {},
|
"inbounds": [],
|
||||||
"outbounds": {},
|
"outbounds": [],
|
||||||
"route": {},
|
"route": {},
|
||||||
"experimental": {}
|
"experimental": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ sing-box 使用 JSON 作为配置文件格式。
|
|||||||
{
|
{
|
||||||
"log": {},
|
"log": {},
|
||||||
"dns": {},
|
"dns": {},
|
||||||
"inbounds": {},
|
"inbounds": [],
|
||||||
"outbounds": {},
|
"outbounds": [],
|
||||||
"route": {},
|
"route": {},
|
||||||
"experimental": {}
|
"experimental": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Log
|
||||||
|
|
||||||
### Structure
|
### Structure
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# 日志
|
||||||
|
|
||||||
### 结构
|
### 结构
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -4,12 +4,8 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "block",
|
||||||
{
|
"tag": "block"
|
||||||
"type": "block",
|
|
||||||
"tag": "block"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,8 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "block",
|
||||||
{
|
"tag": "block"
|
||||||
"type": "block",
|
|
||||||
"tag": "block"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,30 +4,18 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "direct",
|
||||||
{
|
"tag": "direct-out",
|
||||||
"type": "direct",
|
|
||||||
"tag": "direct-out",
|
"override_address": "1.0.0.1",
|
||||||
|
"override_port": 53,
|
||||||
"override_address": "1.0.0.1",
|
"proxy_protocol": 0,
|
||||||
"override_port": 53,
|
|
||||||
"proxy_protocol": 0,
|
... // Dial Fields
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Direct Fields
|
### Fields
|
||||||
|
|
||||||
#### override_address
|
#### override_address
|
||||||
|
|
||||||
@@ -45,54 +33,4 @@ Protocol value can be `1` or `2`.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the requested domain name will be resolved to IP before connect.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -4,30 +4,18 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "direct",
|
||||||
{
|
"tag": "direct-out",
|
||||||
"type": "direct",
|
|
||||||
"tag": "direct-out",
|
"override_address": "1.0.0.1",
|
||||||
|
"override_port": 53,
|
||||||
"override_address": "1.0.0.1",
|
"proxy_protocol": 0,
|
||||||
"override_port": 53,
|
|
||||||
"proxy_protocol": 0,
|
... // 拨号字段
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Direct 字段
|
### 字段
|
||||||
|
|
||||||
#### override_address
|
#### override_address
|
||||||
|
|
||||||
@@ -45,51 +33,4 @@
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,域名将在请求发出之前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -4,12 +4,8 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "dns",
|
||||||
{
|
"tag": "dns-out"
|
||||||
"type": "dns",
|
|
||||||
"tag": "dns-out"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,8 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "dns",
|
||||||
{
|
"tag": "dns-out"
|
||||||
"type": "dns",
|
|
||||||
"tag": "dns-out"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,32 +4,20 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "http",
|
||||||
{
|
"tag": "http-out",
|
||||||
"type": "http",
|
|
||||||
"tag": "http-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"username": "sekai",
|
||||||
"server_port": 1080,
|
"password": "admin",
|
||||||
"username": "sekai",
|
"tls": {},
|
||||||
"password": "admin",
|
|
||||||
"tls": {},
|
... // Dial Fields
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### HTTP Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -57,54 +45,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -4,32 +4,20 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "http",
|
||||||
{
|
"tag": "http-out",
|
||||||
"type": "http",
|
|
||||||
"tag": "http-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"username": "sekai",
|
||||||
"server_port": 1080,
|
"password": "admin",
|
||||||
"username": "sekai",
|
"tls": {},
|
||||||
"password": "admin",
|
|
||||||
"tls": {},
|
... // 拨号字段
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### HTTP 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -57,51 +45,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -2,37 +2,25 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "hysteria",
|
||||||
{
|
"tag": "hysteria-out",
|
||||||
"type": "hysteria",
|
|
||||||
"tag": "hysteria-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"up": "100 Mbps",
|
||||||
"server_port": 1080,
|
"up_mbps": 100,
|
||||||
|
"down": "100 Mbps",
|
||||||
"up": "100 Mbps",
|
"down_mbps": 100,
|
||||||
"up_mbps": 100,
|
"obfs": "fuck me till the daylight",
|
||||||
"down": "100 Mbps",
|
"auth": "",
|
||||||
"down_mbps": 100,
|
"auth_str": "password",
|
||||||
"obfs": "fuck me till the daylight",
|
"recv_window_conn": 0,
|
||||||
"auth": "",
|
"recv_window": 0,
|
||||||
"auth_str": "password",
|
"disable_mtu_discovery": false,
|
||||||
"recv_window_conn": 0,
|
"network": "tcp",
|
||||||
"recv_window": 0,
|
"tls": {},
|
||||||
"disable_mtu_discovery": false,
|
|
||||||
"network": "tcp",
|
... // Dial Fields
|
||||||
"tls": {},
|
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,7 +28,7 @@
|
|||||||
|
|
||||||
QUIC, which is required by hysteria is not included by default, see [Installation](/#installation).
|
QUIC, which is required by hysteria is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
### Hysteria Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -125,54 +113,4 @@ Both is enabled by default.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -2,37 +2,25 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "hysteria",
|
||||||
{
|
"tag": "hysteria-out",
|
||||||
"type": "hysteria",
|
|
||||||
"tag": "hysteria-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"up": "100 Mbps",
|
||||||
"server_port": 1080,
|
"up_mbps": 100,
|
||||||
|
"down": "100 Mbps",
|
||||||
"up": "100 Mbps",
|
"down_mbps": 100,
|
||||||
"up_mbps": 100,
|
"obfs": "fuck me till the daylight",
|
||||||
"down": "100 Mbps",
|
"auth": "",
|
||||||
"down_mbps": 100,
|
"auth_str": "password",
|
||||||
"obfs": "fuck me till the daylight",
|
"recv_window_conn": 0,
|
||||||
"auth": "",
|
"recv_window": 0,
|
||||||
"auth_str": "password",
|
"disable_mtu_discovery": false,
|
||||||
"recv_window_conn": 0,
|
"network": "tcp",
|
||||||
"recv_window": 0,
|
"tls": {},
|
||||||
"disable_mtu_discovery": false,
|
|
||||||
"network": "tcp",
|
... // 拨号字段
|
||||||
"tls": {},
|
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,7 +28,7 @@
|
|||||||
|
|
||||||
默认安装不包含被 Hysteria 依赖的 QUIC,参阅 [安装](/zh/#_2)。
|
默认安装不包含被 Hysteria 依赖的 QUIC,参阅 [安装](/zh/#_2)。
|
||||||
|
|
||||||
### Hysteria 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -123,51 +111,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -2,19 +2,15 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
"type": "selector",
|
||||||
|
"tag": "select",
|
||||||
|
|
||||||
"outbounds": [
|
"outbounds": [
|
||||||
{
|
"proxy-a",
|
||||||
"type": "selector",
|
"proxy-b",
|
||||||
"tag": "select",
|
"proxy-c"
|
||||||
|
],
|
||||||
"outbounds": [
|
"default": "proxy-c"
|
||||||
"proxy-a",
|
|
||||||
"proxy-b",
|
|
||||||
"proxy-c"
|
|
||||||
],
|
|
||||||
"default": "proxy-c"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -2,19 +2,15 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
"type": "selector",
|
||||||
|
"tag": "select",
|
||||||
|
|
||||||
"outbounds": [
|
"outbounds": [
|
||||||
{
|
"proxy-a",
|
||||||
"type": "selector",
|
"proxy-b",
|
||||||
"tag": "select",
|
"proxy-c"
|
||||||
|
],
|
||||||
"outbounds": [
|
"default": "proxy-c"
|
||||||
"proxy-a",
|
|
||||||
"proxy-b",
|
|
||||||
"proxy-c"
|
|
||||||
],
|
|
||||||
"default": "proxy-c"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -2,34 +2,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "shadowsocks",
|
||||||
{
|
"tag": "ss-out",
|
||||||
"type": "shadowsocks",
|
|
||||||
"tag": "ss-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
"server_port": 1080,
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"network": "udp",
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
"udp_over_tcp": false,
|
||||||
"network": "udp",
|
"multiplex": {},
|
||||||
"udp_over_tcp": false,
|
|
||||||
"multiplex": {},
|
... // Dial Fields
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shadowsocks Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -97,54 +85,4 @@ Multiplex configuration, see [Multiplex](/configuration/shared/multiplex).
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -1,35 +1,23 @@
|
|||||||
### Structure
|
### 结构
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "shadowsocks",
|
||||||
{
|
"tag": "ss-out",
|
||||||
"type": "shadowsocks",
|
|
||||||
"tag": "ss-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
"server_port": 1080,
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"network": "udp",
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
"udp_over_tcp": false,
|
||||||
"network": "udp",
|
"multiplex": {},
|
||||||
"udp_over_tcp": false,
|
|
||||||
"multiplex": {},
|
... // 拨号字段
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shadowsocks 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -97,51 +85,4 @@ Shadowsocks 密码。
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
38
docs/configuration/outbound/shadowtls.md
Normal file
38
docs/configuration/outbound/shadowtls.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
### Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "shadowtls",
|
||||||
|
"tag": "st-out",
|
||||||
|
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
|
"tls": {},
|
||||||
|
|
||||||
|
... // Dial Fields
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
|
#### server
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
The server address.
|
||||||
|
|
||||||
|
#### server_port
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
The server port.
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
||||||
|
|
||||||
|
### Dial Fields
|
||||||
|
|
||||||
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
38
docs/configuration/outbound/shadowtls.zh.md
Normal file
38
docs/configuration/outbound/shadowtls.zh.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
### 结构
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "shadowtls",
|
||||||
|
"tag": "st-out",
|
||||||
|
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
|
"tls": {},
|
||||||
|
|
||||||
|
... // 拨号字段
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
|
#### server
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
服务器地址。
|
||||||
|
|
||||||
|
#### server_port
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
服务器端口。
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
||||||
|
|
||||||
|
### 拨号字段
|
||||||
|
|
||||||
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
@@ -4,34 +4,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "socks",
|
||||||
{
|
"tag": "socks-out",
|
||||||
"type": "socks",
|
|
||||||
"tag": "socks-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"version": "5",
|
||||||
"server_port": 1080,
|
"username": "sekai",
|
||||||
"version": "5",
|
"password": "admin",
|
||||||
"username": "sekai",
|
"network": "udp",
|
||||||
"password": "admin",
|
"udp_over_tcp": false,
|
||||||
"network": "udp",
|
|
||||||
"udp_over_tcp": false,
|
|
||||||
|
|
||||||
"detour": "upstream-out",
|
... // Dial Fields
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### SOCKS Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -73,54 +61,4 @@ Enable the UDP over TCP protocol.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -1,37 +1,25 @@
|
|||||||
`socks` 出站是 socks4/socks4a/socks5 客户端
|
`socks` 出站是 socks4/socks4a/socks5 客户端
|
||||||
|
|
||||||
### Structure
|
### 结构
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "socks",
|
||||||
{
|
"tag": "socks-out",
|
||||||
"type": "socks",
|
|
||||||
"tag": "socks-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"version": "5",
|
||||||
"server_port": 1080,
|
"username": "sekai",
|
||||||
"version": "5",
|
"password": "admin",
|
||||||
"username": "sekai",
|
"network": "udp",
|
||||||
"password": "admin",
|
"udp_over_tcp": false,
|
||||||
"network": "udp",
|
|
||||||
"udp_over_tcp": false,
|
|
||||||
|
|
||||||
"detour": "upstream-out",
|
... // 拨号字段
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### SOCKS 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -73,51 +61,4 @@ SOCKS5 密码。
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -2,36 +2,24 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "ssh",
|
||||||
{
|
"tag": "ssh-out",
|
||||||
"type": "ssh",
|
|
||||||
"tag": "ssh-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 22,
|
||||||
"server": "127.0.0.1",
|
"user": "root",
|
||||||
"server_port": 22,
|
"password": "admin",
|
||||||
"user": "root",
|
"private_key": "",
|
||||||
"password": "admin",
|
"private_key_path": "$HOME/.ssh/id_rsa",
|
||||||
"private_key": "",
|
"private_key_passphrase": "",
|
||||||
"private_key_path": "$HOME/.ssh/id_rsa",
|
"host_key_algorithms": [],
|
||||||
"private_key_passphrase": "",
|
"client_version": "SSH-2.0-OpenSSH_7.4p1",
|
||||||
"host_key_algorithms": [],
|
|
||||||
"client_version": "SSH-2.0-OpenSSH_7.4p1",
|
... // Dial Fields
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### SSH Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -73,54 +61,4 @@ Client version. Random version will be used if empty.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -1,37 +1,25 @@
|
|||||||
### Structure
|
### 结构
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "ssh",
|
||||||
{
|
"tag": "ssh-out",
|
||||||
"type": "ssh",
|
|
||||||
"tag": "ssh-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 22,
|
||||||
"server": "127.0.0.1",
|
"user": "root",
|
||||||
"server_port": 22,
|
"password": "admin",
|
||||||
"user": "root",
|
"private_key": "",
|
||||||
"password": "admin",
|
"private_key_path": "$HOME/.ssh/id_rsa",
|
||||||
"private_key": "",
|
"private_key_passphrase": "",
|
||||||
"private_key_path": "$HOME/.ssh/id_rsa",
|
"host_key_algorithms": [],
|
||||||
"private_key_passphrase": "",
|
"client_version": "SSH-2.0-OpenSSH_7.4p1",
|
||||||
"host_key_algorithms": [],
|
|
||||||
"client_version": "SSH-2.0-OpenSSH_7.4p1",
|
... // 拨号字段
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### SSH 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -73,51 +61,4 @@ SSH 用户, 默认使用 root。
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -2,29 +2,17 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "tor",
|
||||||
{
|
"tag": "tor-out",
|
||||||
"type": "tor",
|
|
||||||
"tag": "tor-out",
|
"executable_path": "/usr/bin/tor",
|
||||||
|
"extra_args": [],
|
||||||
"executable_path": "/usr/bin/tor",
|
"data_directory": "$HOME/.cache/tor",
|
||||||
"extra_args": [],
|
"torrc": {
|
||||||
"data_directory": "$HOME/.cache/tor",
|
"ClientOnly": 1
|
||||||
"torrc": {
|
},
|
||||||
"ClientOnly": 1
|
|
||||||
},
|
... // Dial Fields
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -32,7 +20,7 @@
|
|||||||
|
|
||||||
Embedded tor is not included by default, see [Installation](/#installation).
|
Embedded tor is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
### Tor Fields
|
### Fields
|
||||||
|
|
||||||
#### executable_path
|
#### executable_path
|
||||||
|
|
||||||
@@ -56,58 +44,8 @@ Each start will be very slow if not specified.
|
|||||||
|
|
||||||
Map of torrc options.
|
Map of torrc options.
|
||||||
|
|
||||||
See [tor(1)](https://linux.die.net/man/1/tor)
|
See [tor(1)](https://linux.die.net/man/1/tor) for details.
|
||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -2,29 +2,17 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "tor",
|
||||||
{
|
"tag": "tor-out",
|
||||||
"type": "tor",
|
|
||||||
"tag": "tor-out",
|
"executable_path": "/usr/bin/tor",
|
||||||
|
"extra_args": [],
|
||||||
"executable_path": "/usr/bin/tor",
|
"data_directory": "$HOME/.cache/tor",
|
||||||
"extra_args": [],
|
"torrc": {
|
||||||
"data_directory": "$HOME/.cache/tor",
|
"ClientOnly": 1
|
||||||
"torrc": {
|
},
|
||||||
"ClientOnly": 1
|
|
||||||
},
|
... // 拨号字段
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -32,7 +20,7 @@
|
|||||||
|
|
||||||
默认安装不包含嵌入式 Tor, 参阅 [安装](/zh/#_2)。
|
默认安装不包含嵌入式 Tor, 参阅 [安装](/zh/#_2)。
|
||||||
|
|
||||||
### Tor 字段
|
### 字段
|
||||||
|
|
||||||
#### executable_path
|
#### executable_path
|
||||||
|
|
||||||
@@ -60,51 +48,4 @@ torrc 参数表。
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -2,34 +2,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "trojan",
|
||||||
{
|
"tag": "trojan-out",
|
||||||
"type": "trojan",
|
|
||||||
"tag": "trojan-out",
|
|
||||||
|
|
||||||
"server": "127.0.0.1",
|
|
||||||
"server_port": 1080,
|
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
|
||||||
"network": "tcp",
|
|
||||||
"tls": {},
|
|
||||||
"multiplex": {},
|
|
||||||
"transport": {},
|
|
||||||
|
|
||||||
"detour": "upstream-out",
|
"server": "127.0.0.1",
|
||||||
"bind_interface": "en0",
|
"server_port": 1080,
|
||||||
"bind_address": "0.0.0.0",
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
"routing_mark": 1234,
|
"network": "tcp",
|
||||||
"reuse_addr": false,
|
"tls": {},
|
||||||
"connect_timeout": "5s",
|
"multiplex": {},
|
||||||
"tcp_fast_open": false,
|
"transport": {},
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
... // Dial Fields
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Trojan Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -71,54 +59,4 @@ V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -2,34 +2,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "trojan",
|
||||||
{
|
"tag": "trojan-out",
|
||||||
"type": "trojan",
|
|
||||||
"tag": "trojan-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
||||||
"server_port": 1080,
|
"network": "tcp",
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg==",
|
"tls": {},
|
||||||
"network": "tcp",
|
"multiplex": {},
|
||||||
"tls": {},
|
"transport": {},
|
||||||
"multiplex": {},
|
|
||||||
"transport": {},
|
|
||||||
|
|
||||||
"detour": "upstream-out",
|
... // 拨号字段
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Trojan 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -71,51 +59,4 @@ V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-tra
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -2,38 +2,27 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "vmess",
|
||||||
{
|
"tag": "vmess-out",
|
||||||
"type": "vmess",
|
|
||||||
"tag": "vmess-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
||||||
"server_port": 1080,
|
"security": "auto",
|
||||||
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
"alter_id": 0,
|
||||||
"security": "auto",
|
"global_padding": false,
|
||||||
"alter_id": 0,
|
"authenticated_length": true,
|
||||||
"global_padding": false,
|
"network": "tcp",
|
||||||
"authenticated_length": true,
|
"tls": {},
|
||||||
"network": "tcp",
|
"packet_addr": false,
|
||||||
"tls": {},
|
"multiplex": {},
|
||||||
"multiplex": {},
|
"transport": {},
|
||||||
"transport": {},
|
|
||||||
|
|
||||||
"detour": "upstream-out",
|
... // Dial Fields
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### VMess Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -95,6 +84,10 @@ Both is enabled by default.
|
|||||||
|
|
||||||
TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
||||||
|
|
||||||
|
#### packet_addr
|
||||||
|
|
||||||
|
Enable packetaddr support.
|
||||||
|
|
||||||
#### multiplex
|
#### multiplex
|
||||||
|
|
||||||
Multiplex configuration, see [Multiplex](/configuration/shared/multiplex).
|
Multiplex configuration, see [Multiplex](/configuration/shared/multiplex).
|
||||||
@@ -105,54 +98,4 @@ V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -2,36 +2,27 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "vmess",
|
||||||
{
|
"tag": "vmess-out",
|
||||||
"type": "vmess",
|
|
||||||
"tag": "vmess-out",
|
"server": "127.0.0.1",
|
||||||
"server": "127.0.0.1",
|
"server_port": 1080,
|
||||||
"server_port": 1080,
|
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
||||||
"uuid": "bf000d23-0752-40b4-affe-68f7707a9661",
|
"security": "auto",
|
||||||
"security": "auto",
|
"alter_id": 0,
|
||||||
"alter_id": 0,
|
"global_padding": false,
|
||||||
"global_padding": false,
|
"authenticated_length": true,
|
||||||
"authenticated_length": true,
|
"network": "tcp",
|
||||||
"network": "tcp",
|
"tls": {},
|
||||||
"tls": {},
|
"packet_addr": false,
|
||||||
"multiplex": {},
|
"multiplex": {},
|
||||||
"transport": {},
|
"transport": {},
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
... // 拨号字段
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### VMess 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -93,6 +84,10 @@ VMess 用户 ID。
|
|||||||
|
|
||||||
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
||||||
|
|
||||||
|
#### packet_addr
|
||||||
|
|
||||||
|
启用 packetaddr 支持。
|
||||||
|
|
||||||
#### multiplex
|
#### multiplex
|
||||||
|
|
||||||
多路复用配置, 参阅 [多路复用](/zh/configuration/shared/multiplex)。
|
多路复用配置, 参阅 [多路复用](/zh/configuration/shared/multiplex)。
|
||||||
@@ -103,51 +98,4 @@ V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-tra
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -2,34 +2,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "wireguard",
|
||||||
{
|
"tag": "wireguard-out",
|
||||||
"type": "wireguard",
|
|
||||||
"tag": "wireguard-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"local_address": [
|
||||||
"server_port": 1080,
|
"10.0.0.1",
|
||||||
"local_address": [
|
"10.0.0.2/32"
|
||||||
"10.0.0.1",
|
],
|
||||||
"10.0.0.2/32"
|
"private_key": "YNXtAzepDqRv9H52osJVDQnznT5AM11eCK3ESpwSt04=",
|
||||||
],
|
"peer_public_key": "Z1XXLsKYkYxuiYjJIkRvtIKFepCYHTgON+GwPq7SOV4=",
|
||||||
"private_key": "YNXtAzepDqRv9H52osJVDQnznT5AM11eCK3ESpwSt04=",
|
"pre_shared_key": "31aIhAPwktDGpH4JDhA8GNvjFXEf/a6+UaQRyOAiyfM=",
|
||||||
"peer_public_key": "Z1XXLsKYkYxuiYjJIkRvtIKFepCYHTgON+GwPq7SOV4=",
|
"mtu": 1408,
|
||||||
"pre_shared_key": "31aIhAPwktDGpH4JDhA8GNvjFXEf/a6+UaQRyOAiyfM=",
|
"network": "tcp",
|
||||||
"mtu": 1408,
|
|
||||||
"network": "tcp",
|
... // Dial Fields
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -37,7 +25,7 @@
|
|||||||
|
|
||||||
WireGuard is not included by default, see [Installation](/#installation).
|
WireGuard is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
### WireGuard Fields
|
### Fields
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -92,54 +80,4 @@ Both is enabled by default.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
#### detour
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
||||||
The tag of the upstream outbound.
|
|
||||||
|
|
||||||
Other dial fields will be ignored when enabled.
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
The network interface to bind to.
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
The address to bind to.
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
Only supported on Linux.
|
|
||||||
|
|
||||||
Set netfilter routing mark.
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
Reuse listener address.
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
Connect timeout, in golang's Duration format.
|
|
||||||
|
|
||||||
A duration string is a possibly signed sequence of
|
|
||||||
decimal numbers, each with optional fraction and a unit suffix,
|
|
||||||
such as "300ms", "-1.5h" or "2h45m".
|
|
||||||
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
|
||||||
|
|
||||||
If set, the server domain name will be resolved to IP before connecting.
|
|
||||||
|
|
||||||
`dns.strategy` will be used if empty.
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
|
||||||
That is, is the amount of time to wait for IPv6 to succeed before assuming
|
|
||||||
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
|
|
||||||
If zero, a default delay of 300ms is used.
|
|
||||||
|
|
||||||
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.
|
|
||||||
|
|||||||
@@ -2,34 +2,22 @@
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"outbounds": [
|
"type": "wireguard",
|
||||||
{
|
"tag": "wireguard-out",
|
||||||
"type": "wireguard",
|
|
||||||
"tag": "wireguard-out",
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
"server": "127.0.0.1",
|
"local_address": [
|
||||||
"server_port": 1080,
|
"10.0.0.1",
|
||||||
"local_address": [
|
"10.0.0.2/32"
|
||||||
"10.0.0.1",
|
],
|
||||||
"10.0.0.2/32"
|
"private_key": "YNXtAzepDqRv9H52osJVDQnznT5AM11eCK3ESpwSt04=",
|
||||||
],
|
"peer_public_key": "Z1XXLsKYkYxuiYjJIkRvtIKFepCYHTgON+GwPq7SOV4=",
|
||||||
"private_key": "YNXtAzepDqRv9H52osJVDQnznT5AM11eCK3ESpwSt04=",
|
"pre_shared_key": "31aIhAPwktDGpH4JDhA8GNvjFXEf/a6+UaQRyOAiyfM=",
|
||||||
"peer_public_key": "Z1XXLsKYkYxuiYjJIkRvtIKFepCYHTgON+GwPq7SOV4=",
|
"mtu": 1408,
|
||||||
"pre_shared_key": "31aIhAPwktDGpH4JDhA8GNvjFXEf/a6+UaQRyOAiyfM=",
|
"network": "tcp",
|
||||||
"mtu": 1408,
|
|
||||||
"network": "tcp",
|
... // 拨号字段
|
||||||
|
|
||||||
"detour": "upstream-out",
|
|
||||||
"bind_interface": "en0",
|
|
||||||
"bind_address": "0.0.0.0",
|
|
||||||
"routing_mark": 1234,
|
|
||||||
"reuse_addr": false,
|
|
||||||
"connect_timeout": "5s",
|
|
||||||
"tcp_fast_open": false,
|
|
||||||
"domain_strategy": "prefer_ipv6",
|
|
||||||
"fallback_delay": "300ms"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -37,7 +25,7 @@
|
|||||||
|
|
||||||
默认安装不包含 WireGuard, 参阅 [安装](/zh/#_2)。
|
默认安装不包含 WireGuard, 参阅 [安装](/zh/#_2)。
|
||||||
|
|
||||||
### WireGuard 字段
|
### 字段
|
||||||
|
|
||||||
#### server
|
#### server
|
||||||
|
|
||||||
@@ -94,51 +82,4 @@ WireGuard MTU。 默认1408。
|
|||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
#### detour
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
||||||
上游出站的标签。
|
|
||||||
|
|
||||||
启用时,其他拨号字段将被忽略。
|
|
||||||
|
|
||||||
#### bind_interface
|
|
||||||
|
|
||||||
要绑定到的网络接口。
|
|
||||||
|
|
||||||
#### bind_address
|
|
||||||
|
|
||||||
要绑定的地址。
|
|
||||||
|
|
||||||
#### routing_mark
|
|
||||||
|
|
||||||
!!! error ""
|
|
||||||
|
|
||||||
仅支持 Linux。
|
|
||||||
|
|
||||||
设置 netfilter 路由标记。
|
|
||||||
|
|
||||||
#### reuse_addr
|
|
||||||
|
|
||||||
重用监听地址。
|
|
||||||
|
|
||||||
#### connect_timeout
|
|
||||||
|
|
||||||
连接超时,采用 golang 的 Duration 格式。
|
|
||||||
|
|
||||||
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
|
||||||
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
|
||||||
|
|
||||||
#### domain_strategy
|
|
||||||
|
|
||||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
|
||||||
|
|
||||||
如果设置,服务器域名将在连接前解析为 IP。
|
|
||||||
|
|
||||||
默认使用 `dns.strategy`。
|
|
||||||
|
|
||||||
#### fallback_delay
|
|
||||||
|
|
||||||
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
|
||||||
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
|
||||||
如果为零,则使用 300 毫秒的默认延迟。
|
|
||||||
|
|
||||||
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
|
||||||
|
|||||||
@@ -68,6 +68,9 @@
|
|||||||
"process_name": [
|
"process_name": [
|
||||||
"curl"
|
"curl"
|
||||||
],
|
],
|
||||||
|
"process_path": [
|
||||||
|
"/usr/bin/curl"
|
||||||
|
],
|
||||||
"package_name": [
|
"package_name": [
|
||||||
"com.termux"
|
"com.termux"
|
||||||
],
|
],
|
||||||
@@ -188,6 +191,14 @@ Match port range.
|
|||||||
|
|
||||||
Match process name.
|
Match process name.
|
||||||
|
|
||||||
|
#### process_path
|
||||||
|
|
||||||
|
!!! error ""
|
||||||
|
|
||||||
|
Only supported on Linux, Windows, and macOS.
|
||||||
|
|
||||||
|
Match process path.
|
||||||
|
|
||||||
#### package_name
|
#### package_name
|
||||||
|
|
||||||
Match android package name.
|
Match android package name.
|
||||||
|
|||||||
@@ -66,6 +66,9 @@
|
|||||||
"process_name": [
|
"process_name": [
|
||||||
"curl"
|
"curl"
|
||||||
],
|
],
|
||||||
|
"process_path": [
|
||||||
|
"/usr/bin/curl"
|
||||||
|
],
|
||||||
"package_name": [
|
"package_name": [
|
||||||
"com.termux"
|
"com.termux"
|
||||||
],
|
],
|
||||||
@@ -186,6 +189,14 @@
|
|||||||
|
|
||||||
匹配进程名称。
|
匹配进程名称。
|
||||||
|
|
||||||
|
#### process_path
|
||||||
|
|
||||||
|
!!! error ""
|
||||||
|
|
||||||
|
仅支持 Linux、Windows 和 macOS.
|
||||||
|
|
||||||
|
匹配进程路径。
|
||||||
|
|
||||||
#### package_name
|
#### package_name
|
||||||
|
|
||||||
匹配 Android 应用包名。
|
匹配 Android 应用包名。
|
||||||
|
|||||||
74
docs/configuration/shared/dial.md
Normal file
74
docs/configuration/shared/dial.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
### Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"detour": "upstream-out",
|
||||||
|
"bind_interface": "en0",
|
||||||
|
"bind_address": "0.0.0.0",
|
||||||
|
"routing_mark": 1234,
|
||||||
|
"reuse_addr": false,
|
||||||
|
"connect_timeout": "5s",
|
||||||
|
"tcp_fast_open": false,
|
||||||
|
"domain_strategy": "prefer_ipv6",
|
||||||
|
"fallback_delay": "300ms"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
|
| Field | Available Context |
|
||||||
|
|-----------------------------------------------------------------------------------|-------------------|
|
||||||
|
| `bind_interface` /`bind_address` /`routing_mark` /`reuse_addr` /`connect_timeout` | `detour` not set |
|
||||||
|
|
||||||
|
#### detour
|
||||||
|
|
||||||
|
The tag of the upstream outbound.
|
||||||
|
|
||||||
|
#### bind_interface
|
||||||
|
|
||||||
|
The network interface to bind to.
|
||||||
|
|
||||||
|
#### bind_address
|
||||||
|
|
||||||
|
The address to bind to.
|
||||||
|
|
||||||
|
#### routing_mark
|
||||||
|
|
||||||
|
!!! error ""
|
||||||
|
|
||||||
|
Only supported on Linux.
|
||||||
|
|
||||||
|
Set netfilter routing mark.
|
||||||
|
|
||||||
|
#### reuse_addr
|
||||||
|
|
||||||
|
Reuse listener address.
|
||||||
|
|
||||||
|
#### connect_timeout
|
||||||
|
|
||||||
|
Connect timeout, in golang's Duration format.
|
||||||
|
|
||||||
|
A duration string is a possibly signed sequence of
|
||||||
|
decimal numbers, each with optional fraction and a unit suffix,
|
||||||
|
such as "300ms", "-1.5h" or "2h45m".
|
||||||
|
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
||||||
|
|
||||||
|
#### domain_strategy
|
||||||
|
|
||||||
|
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
||||||
|
|
||||||
|
If set, the requested domain name will be resolved to IP before connect.
|
||||||
|
|
||||||
|
| Outbound | Effected domains | Fallback Value |
|
||||||
|
|----------|--------------------------|-------------------------------------------|
|
||||||
|
| `direct` | Domain in request | Take `inbound.domain_strategy` if not set |
|
||||||
|
| others | Domain in server address | / |
|
||||||
|
|
||||||
|
#### fallback_delay
|
||||||
|
|
||||||
|
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
|
||||||
|
That is, is the amount of time to wait for connection to succeed before assuming
|
||||||
|
that IPv4/IPv6 is misconfigured and falling back to other type of addresses.
|
||||||
|
If zero, a default delay of 300ms is used.
|
||||||
|
|
||||||
|
Only take effect when `domain_strategy` is set.
|
||||||
66
docs/configuration/shared/dial.zh.md
Normal file
66
docs/configuration/shared/dial.zh.md
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
### 结构
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"detour": "upstream-out",
|
||||||
|
"bind_interface": "en0",
|
||||||
|
"bind_address": "0.0.0.0",
|
||||||
|
"routing_mark": 1234,
|
||||||
|
"reuse_addr": false,
|
||||||
|
"connect_timeout": "5s",
|
||||||
|
"tcp_fast_open": false,
|
||||||
|
"domain_strategy": "prefer_ipv6",
|
||||||
|
"fallback_delay": "300ms"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
|
#### detour
|
||||||
|
|
||||||
|
上游出站的标签。
|
||||||
|
|
||||||
|
启用时,其他拨号字段将被忽略。
|
||||||
|
|
||||||
|
#### bind_interface
|
||||||
|
|
||||||
|
要绑定到的网络接口。
|
||||||
|
|
||||||
|
#### bind_address
|
||||||
|
|
||||||
|
要绑定的地址。
|
||||||
|
|
||||||
|
#### routing_mark
|
||||||
|
|
||||||
|
!!! error ""
|
||||||
|
|
||||||
|
仅支持 Linux。
|
||||||
|
|
||||||
|
设置 netfilter 路由标记。
|
||||||
|
|
||||||
|
#### reuse_addr
|
||||||
|
|
||||||
|
重用监听地址。
|
||||||
|
|
||||||
|
#### connect_timeout
|
||||||
|
|
||||||
|
连接超时,采用 golang 的 Duration 格式。
|
||||||
|
|
||||||
|
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
|
||||||
|
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
|
||||||
|
|
||||||
|
#### domain_strategy
|
||||||
|
|
||||||
|
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
||||||
|
|
||||||
|
如果设置,域名将在请求发出之前解析为 IP。
|
||||||
|
|
||||||
|
默认使用 `dns.strategy`。
|
||||||
|
|
||||||
|
#### fallback_delay
|
||||||
|
|
||||||
|
在生成 RFC 6555 快速回退连接之前等待的时间长度。
|
||||||
|
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
|
||||||
|
如果为零,则使用 300 毫秒的默认延迟。
|
||||||
|
|
||||||
|
仅当 `domain_strategy` 为 `prefer_ipv4` 或 `prefer_ipv6` 时生效。
|
||||||
73
docs/configuration/shared/listen.md
Normal file
73
docs/configuration/shared/listen.md
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
### Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"listen": "::",
|
||||||
|
"listen_port": 5353,
|
||||||
|
"tcp_fast_open": false,
|
||||||
|
"sniff": false,
|
||||||
|
"sniff_override_destination": false,
|
||||||
|
"domain_strategy": "prefer_ipv6",
|
||||||
|
"udp_timeout": 300,
|
||||||
|
"proxy_protocol": false,
|
||||||
|
"detour": "another-in"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
|
| Field | Available Context |
|
||||||
|
|------------------|-------------------------------------------------------------------|
|
||||||
|
| `listen` | Needs to listen on TCP or UDP. |
|
||||||
|
| `listen_port` | Needs to listen on TCP or UDP. |
|
||||||
|
| `tcp_fast_open` | Needs to listen on TCP. |
|
||||||
|
| `udp_timeout` | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
|
||||||
|
| `proxy_protocol` | Needs to listen on TCP. |
|
||||||
|
|
||||||
|
#### listen
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
Listen address.
|
||||||
|
|
||||||
|
#### listen_port
|
||||||
|
|
||||||
|
Listen port.
|
||||||
|
|
||||||
|
#### tcp_fast_open
|
||||||
|
|
||||||
|
Enable tcp fast open for listener.
|
||||||
|
|
||||||
|
#### sniff
|
||||||
|
|
||||||
|
Enable sniffing.
|
||||||
|
|
||||||
|
See [Protocol Sniff](/configuration/route/sniff/) for details.
|
||||||
|
|
||||||
|
#### sniff_override_destination
|
||||||
|
|
||||||
|
Override the connection destination address with the sniffed domain.
|
||||||
|
|
||||||
|
If the domain name is invalid (like tor), this will not work.
|
||||||
|
|
||||||
|
#### domain_strategy
|
||||||
|
|
||||||
|
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
||||||
|
|
||||||
|
If set, the requested domain name will be resolved to IP before routing.
|
||||||
|
|
||||||
|
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
|
||||||
|
|
||||||
|
#### udp_timeout
|
||||||
|
|
||||||
|
UDP NAT expiration time in seconds, default is 300 (5 minutes).
|
||||||
|
|
||||||
|
#### proxy_protocol
|
||||||
|
|
||||||
|
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
|
||||||
|
|
||||||
|
#### detour
|
||||||
|
|
||||||
|
If set, connections will be forwarded to the specified inbound.
|
||||||
|
|
||||||
|
Requires target inbound support, see [Injectable](/configuration/inbound/#fields).
|
||||||
72
docs/configuration/shared/listen.zh.md
Normal file
72
docs/configuration/shared/listen.zh.md
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
### 结构
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"listen": "::",
|
||||||
|
"listen_port": 5353,
|
||||||
|
"tcp_fast_open": false,
|
||||||
|
"sniff": false,
|
||||||
|
"sniff_override_destination": false,
|
||||||
|
"domain_strategy": "prefer_ipv6",
|
||||||
|
"udp_timeout": 300,
|
||||||
|
"detour": "another-in"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 字段 | 可用上下文 |
|
||||||
|
|------------------|-------------------------------------|
|
||||||
|
| `listen` | 需要监听 TCP 或 UDP。 |
|
||||||
|
| `listen_port` | 需要监听 TCP 或 UDP。 |
|
||||||
|
| `tcp_fast_open` | 需要监听 TCP。 |
|
||||||
|
| `udp_timeout` | 需要组装 UDP 连接, 当前为 Tun 和 Shadowsocks。 |
|
||||||
|
| `proxy_protocol` | 需要监听 TCP。 |
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
|
#### listen
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
监听地址。
|
||||||
|
|
||||||
|
#### listen_port
|
||||||
|
|
||||||
|
监听端口。
|
||||||
|
|
||||||
|
#### tcp_fast_open
|
||||||
|
|
||||||
|
为监听器启用 TCP 快速打开。
|
||||||
|
|
||||||
|
#### sniff
|
||||||
|
|
||||||
|
启用协议探测。
|
||||||
|
|
||||||
|
参阅 [协议探测](/zh/configuration/route/sniff/)
|
||||||
|
|
||||||
|
#### sniff_override_destination
|
||||||
|
|
||||||
|
用探测出的域名覆盖连接目标地址。
|
||||||
|
|
||||||
|
如果域名无效(如 Tor),将不生效。
|
||||||
|
|
||||||
|
#### domain_strategy
|
||||||
|
|
||||||
|
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
||||||
|
|
||||||
|
如果设置,请求的域名将在路由之前解析为 IP。
|
||||||
|
|
||||||
|
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
||||||
|
|
||||||
|
#### udp_timeout
|
||||||
|
|
||||||
|
UDP NAT 过期时间,以秒为单位,默认为 300(5 分钟)。
|
||||||
|
|
||||||
|
#### proxy_protocol
|
||||||
|
|
||||||
|
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|
||||||
|
|
||||||
|
#### detour
|
||||||
|
|
||||||
|
如果设置,连接将被转发到指定的入站。
|
||||||
|
|
||||||
|
需要目标入站支持,参阅 [注入支持](/zh/configuration/inbound/#_3)。
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
"disable_sni": false,
|
||||||
"server_name": "",
|
"server_name": "",
|
||||||
"insecure": false,
|
"insecure": false,
|
||||||
"alpn": [],
|
"alpn": [],
|
||||||
@@ -87,14 +88,18 @@ Cipher suite values:
|
|||||||
|
|
||||||
Enable TLS.
|
Enable TLS.
|
||||||
|
|
||||||
|
#### disable_sni
|
||||||
|
|
||||||
|
==Client only==
|
||||||
|
|
||||||
|
Do not send server name in ClientHello.
|
||||||
|
|
||||||
#### server_name
|
#### server_name
|
||||||
|
|
||||||
Used to verify the hostname on the returned certificates unless insecure is given.
|
Used to verify the hostname on the returned certificates unless insecure is given.
|
||||||
|
|
||||||
It is also included in the client's handshake to support virtual hosting unless it is an IP address.
|
It is also included in the client's handshake to support virtual hosting unless it is an IP address.
|
||||||
|
|
||||||
See [Server Name Indication](https://en.wikipedia.org/wiki/Server_Name_Indication).
|
|
||||||
|
|
||||||
#### insecure
|
#### insecure
|
||||||
|
|
||||||
==Client only==
|
==Client only==
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
"disable_sni": false,
|
||||||
"server_name": "",
|
"server_name": "",
|
||||||
"insecure": false,
|
"insecure": false,
|
||||||
"alpn": [],
|
"alpn": [],
|
||||||
@@ -87,14 +88,18 @@ TLS 版本值:
|
|||||||
|
|
||||||
启用 TLS
|
启用 TLS
|
||||||
|
|
||||||
|
#### disable_sni
|
||||||
|
|
||||||
|
==仅客户端==
|
||||||
|
|
||||||
|
不要在 ClientHello 中发送服务器名称.
|
||||||
|
|
||||||
#### server_name
|
#### server_name
|
||||||
|
|
||||||
用于验证返回证书上的主机名,除非设置不安全。
|
用于验证返回证书上的主机名,除非设置不安全。
|
||||||
|
|
||||||
它还包含在 ClientHello 中以支持虚拟主机,除非它是 IP 地址。
|
它还包含在 ClientHello 中以支持虚拟主机,除非它是 IP 地址。
|
||||||
|
|
||||||
参阅 [Server Name Indication](https://en.wikipedia.org/wiki/Server_Name_Indication)。
|
|
||||||
|
|
||||||
#### insecure
|
#### insecure
|
||||||
|
|
||||||
==仅客户端==
|
==仅客户端==
|
||||||
@@ -208,7 +213,8 @@ EAB(外部帐户绑定)包含将 ACME 帐户绑定或映射到其他已知
|
|||||||
|
|
||||||
外部帐户绑定“用于将 ACME 帐户与非 ACME 系统中的现有帐户相关联,例如 CA 客户数据库。
|
外部帐户绑定“用于将 ACME 帐户与非 ACME 系统中的现有帐户相关联,例如 CA 客户数据库。
|
||||||
|
|
||||||
为了启用 ACME 帐户绑定,运行 ACME 服务器的 CA 需要向 ACME 客户端提供 MAC 密钥和密钥标识符,使用 ACME 之外的一些机制。 §7.3.4
|
为了启用 ACME 帐户绑定,运行 ACME 服务器的 CA 需要向 ACME 客户端提供 MAC 密钥和密钥标识符,使用 ACME 之外的一些机制。
|
||||||
|
§7.3.4
|
||||||
|
|
||||||
#### external_account.key_id
|
#### external_account.key_id
|
||||||
|
|
||||||
|
|||||||
@@ -119,9 +119,9 @@ It needs to be consistent with the server.
|
|||||||
|
|
||||||
### gRPC
|
### gRPC
|
||||||
|
|
||||||
!!! warning ""
|
!!! note ""
|
||||||
|
|
||||||
gRPC is not included by default, see [Installation](/#installation).
|
standard gRPC has good compatibility but poor performance and is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user