1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-05 20:57:02 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-01-29 22:33:10 +08:00
parent ddf48abff8
commit 39908a29b1

View File

@ -2,6 +2,7 @@ package web
import (
"net"
"strings"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/aaa"
@ -56,15 +57,9 @@ func init() {
}},
SERVE_START: {Hand: func(m *ice.Message, arg ...string) { gdb.Go(m, _broad_serve) }},
SERVE: {Name: "serve port=9020 host", Hand: func(m *ice.Message, arg ...string) { gdb.Go(m, _broad_serve) }},
ADMIN: {Hand: func(m *ice.Message, arg ...string) {
m.ProcessOpen(Domain(m.Option(mdb.NAME), m.Option(tcp.PORT)) + C(m.ActionKey()))
}},
DREAM: {Hand: func(m *ice.Message, arg ...string) {
m.ProcessOpen(Domain(m.Option(mdb.NAME), m.Option(tcp.PORT)) + C(m.ActionKey()))
}},
VIMER: {Hand: func(m *ice.Message, arg ...string) {
m.ProcessOpen(Domain(m.Option(mdb.NAME), m.Option(tcp.PORT)) + C(m.ActionKey()))
}},
ADMIN: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
DREAM: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
VIMER: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
OPEN: {Hand: func(m *ice.Message, arg ...string) { m.ProcessOpen(Domain(m.Option(mdb.NAME), m.Option(tcp.PORT))) }},
tcp.SEND: {Hand: func(m *ice.Message, arg ...string) { _broad_send(m, "", "", "", "", arg...) }},
}, gdb.EventsAction(SERVE_START), mdb.HashAction(mdb.SHORT, "host,port",
@ -72,3 +67,6 @@ func init() {
mdb.ACTION, "admin,dream,vimer,open", mdb.SORT, "type,name,host,port"), mdb.ClearOnExitHashAction())},
})
}
func broadOpen(m *ice.Message) {
m.ProcessOpen(Domain(strings.TrimSuffix(m.Option(mdb.NAME), ".local")+".local", m.Option(tcp.PORT)) + C(m.ActionKey()))
}