mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-24 09:18:27 +00:00
the PR spiraled and ended up being much larger than anticipated. it is a refactor of wshrouter to have it track "links" as opposed to just routes. this lets us simplify a lot of things when it comes to multi-level routing. * now the router can handle unauthenticated links directly, instead of a weird limbo in wshproxy * no more wshmultiproxy * no more "authtoken" weirdness * more straightforward handling in connserver (when using router option) also adds more debugging, more logging, some windows fixes, other wsl fixes
27 lines
616 B
Go
27 lines
616 B
Go
// Copyright 2025, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package wshserver
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/wavetermdev/waveterm/pkg/wshrpc"
|
|
"github.com/wavetermdev/waveterm/pkg/wshutil"
|
|
)
|
|
|
|
const (
|
|
DefaultOutputChSize = 32
|
|
DefaultInputChSize = 32
|
|
)
|
|
|
|
var waveSrvClient_Singleton *wshutil.WshRpc
|
|
var waveSrvClient_Once = &sync.Once{}
|
|
|
|
// returns the wavesrv main rpc client singleton
|
|
func GetMainRpcClient() *wshutil.WshRpc {
|
|
waveSrvClient_Once.Do(func() {
|
|
waveSrvClient_Singleton = wshutil.MakeWshRpc(wshrpc.RpcContext{}, &WshServerImpl, "main-client")
|
|
})
|
|
return waveSrvClient_Singleton
|
|
}
|