Add SSH inbound, log level. Update MTPROXY. Fixes

This commit is contained in:
Shtorm
2026-06-07 07:59:43 +03:00
parent 6f6af8e902
commit 9f5ccf43d4
115 changed files with 2742 additions and 527 deletions

View File

@@ -87,7 +87,7 @@ func (h *Inbound) Start(stage adapter.StartStage) error {
return fmt.Errorf("failed to start mieru server: %w", err)
}
h.logger.Info("mieru server is started")
h.logger.Notice("mieru server is started")
go h.acceptLoop()
return nil
}
@@ -275,14 +275,21 @@ func buildMieruServerConfig(_ context.Context, options option.MieruInboundOption
transportProtocol = mierupb.TransportProtocol_UDP.Enum()
}
if options.ListenOptions.ListenPort == 0 {
return nil, nil, E.New("listen_port must be set")
if options.ListenOptions.ListenPort == 0 && len(options.ListenPorts) == 0 {
return nil, nil, E.New("either listen_port or listen_ports must be set")
}
portBindings := []*mierupb.PortBinding{
{
var portBindings []*mierupb.PortBinding
if options.ListenOptions.ListenPort != 0 {
portBindings = append(portBindings, &mierupb.PortBinding{
Port: proto.Int32(int32(options.ListenOptions.ListenPort)),
Protocol: transportProtocol,
},
})
}
for _, pr := range options.ListenPorts {
portBindings = append(portBindings, &mierupb.PortBinding{
PortRange: proto.String(pr),
Protocol: transportProtocol,
})
}
var users []*mierupb.User

View File

@@ -53,7 +53,7 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL
if err := c.Start(); err != nil {
return nil, fmt.Errorf("failed to start mieru client: %w", err)
}
logger.InfoContext(ctx, "mieru client is started")
logger.NoticeContext(ctx, "mieru client is started")
return &Outbound{
Adapter: outbound.NewAdapterWithDialerOptions(C.TypeMieru, tag, []string{N.NetworkTCP, N.NetworkUDP}, options.DialerOptions),