MCPcopy
hub / github.com/MetaCubeX/mihomo

github.com/MetaCubeX/mihomo @v1.19.27 sqlite

repository ↗ · DeepWiki ↗ · release v1.19.27 ↗
7,267 symbols 24,577 edges 850 files 1,236 documented · 17%
README

Meta Kennel Meta Kernel

Another Mihomo Kernel.

Features

  • Local HTTP/HTTPS/SOCKS server with authentication support
  • VMess, VLESS, Shadowsocks, Trojan, Snell, TUIC, Hysteria protocol support
  • Built-in DNS server that aims to minimize DNS pollution attack impact, supports DoH/DoT upstream and fake IP.
  • Rules based off domains, GEOIP, IPCIDR or Process to forward packets to different nodes
  • Remote groups allow users to implement powerful rules. Supports automatic fallback, load balancing or auto select node based off latency
  • Remote providers, allowing users to get node lists remotely instead of hard-coding in config
  • Netfilter TCP redirecting. Deploy Mihomo on your Internet gateway with iptables.
  • Comprehensive HTTP RESTful API controller

Dashboard

A web dashboard with first-class support for this project has been created; it can be checked out at metacubexd.

Configration example

Configuration example is located at /docs/config.yaml.

Docs

Documentation can be found in mihomo Docs.

For development

Requirements: Go 1.20 or newer

Build mihomo:

git clone https://github.com/MetaCubeX/mihomo.git
cd mihomo && go mod download
go build

Set go proxy if a connection to GitHub is not possible:

go env -w GOPROXY=https://goproxy.io,direct

Build with gvisor tun stack:

go build -tags with_gvisor

IPTABLES configuration

Work on Linux OS which supported iptables

# Enable the TPROXY listener
tproxy-port: 9898

iptables:
  enable: true # default is false
  inbound-interface: eth0 # detect the inbound interface, default is 'lo'

Debugging

Check wiki to get an instruction on using debug API.

Credits

License

This software is released under the GPL-3.0 license.

In addition, any downstream projects not affiliated with MetaCubeX shall not contain the word mihomo in their names.

Extension points exported contracts — how you extend this code

IndexMatcher (Interface)
IndexMatcher is the interface for matching with a group of matchers. [34 implementers]
component/geodata/strmatcher/strmatcher.go
UDPPacket (Interface)
UDPPacket contains the data of UDP packet, and offers control/info of UDP packet's source [12 implementers]
constant/adapters.go
NetDialer (Interface)
(no doc) [48 implementers]
component/dialer/options.go
StreamConnCipher (Interface)
(no doc) [14 implementers]
transport/shadowsocks/core/cipher.go
Obfs (Interface)
(no doc) [14 implementers]
transport/ssr/obfs/obfs.go
UDPConn (Interface)
(no doc) [13 implementers]
transport/hysteria/core/client.go
Listener (Interface)
(no doc) [11 implementers]
constant/listener.go
WaitReadFrom (Interface)
(no doc) [17 implementers]
common/net/packet/packet.go

Core symbols most depended-on inside this repo

Write
called by 535
constant/provider/interface.go
New
called by 493
component/geodata/strmatcher/strmatcher.go
Equal
called by 388
constant/listener.go
String
called by 369
component/geodata/strmatcher/strmatcher.go
Set
called by 292
adapter/outboundgroup/util.go
Get
called by 277
common/pool/alloc.go
Close
called by 267
transport/masque/masque.go
Close
called by 251
constant/listener.go

Shape

Method 3,516
Function 2,518
Struct 986
Interface 114
TypeAlias 89
FuncType 44

Languages

Go100%

Modules by API surface

common/xsync/map_test.go101 symbols
transport/sudoku/obfs/httpmask/tunnel.go98 symbols
component/geodata/router/config.pb.go75 symbols
constant/adapters.go73 symbols
config/config.go64 symbols
transport/tuic/v4/protocol.go59 symbols
transport/tuic/congestion_v2/bandwidth_sampler.go58 symbols
common/xsync/map.go58 symbols
adapter/outbound/base.go53 symbols
transport/tuic/congestion_v2/bbr_sender.go50 symbols
transport/openvpn/control.go50 symbols
transport/tuic/v5/protocol.go49 symbols

Dependencies from manifests, versioned

github.com/3andne/restls-client-gov0.1.6 · 1×
github.com/Microsoft/go-winiov0.6.0 · 1×
github.com/RyuaNerin/go-kryptov1.3.0 · 1×
github.com/Yawning/aezv0.0.0-2021102704491 · 1×
github.com/aead/chacha20v0.0.0-2018070915024 · 1×
github.com/ajg/formv1.5.1 · 1×
github.com/akutz/memconnv0.1.0 · 1×
github.com/alexbrainman/sspiv0.0.0-2023101608002 · 1×
github.com/andybalholm/brotliv1.1.1 · 1×
github.com/bahlo/generic-list-gov0.2.0 · 1×
github.com/bodgit/plumbingv1.3.0 · 1×
github.com/bodgit/windowsv1.0.1 · 1×

For agents

$ claude mcp add mihomo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact