mirror of
https://github.com/tale/headplane.git
synced 2026-08-20 18:02:17 +00:00
feat: initial webssh tooling
This commit is contained in:
+20
-4
@@ -28,6 +28,11 @@ const config = await loadConfig(
|
||||
}),
|
||||
);
|
||||
|
||||
const agentManager = await loadAgentSocket(
|
||||
config.integration?.agent,
|
||||
config.headscale.url,
|
||||
);
|
||||
|
||||
// We also use this file to load anything needed by the react router code.
|
||||
// These are usually per-request things that we need access to, like the
|
||||
// helper that can issue and revoke cookies.
|
||||
@@ -56,10 +61,7 @@ const appLoadContext = {
|
||||
config.headscale.tls_cert_path,
|
||||
),
|
||||
|
||||
agents: await loadAgentSocket(
|
||||
config.integration?.agent,
|
||||
config.headscale.url,
|
||||
),
|
||||
agents: agentManager,
|
||||
integration: await loadIntegration(config.integration),
|
||||
oidc: config.oidc ? await createOidcClient(config.oidc) : undefined,
|
||||
};
|
||||
@@ -85,4 +87,18 @@ export default createHonoServer({
|
||||
listeningListener(info) {
|
||||
log.info('server', 'Running on %s:%s', info.address, info.port);
|
||||
},
|
||||
|
||||
useWebSocket: true,
|
||||
configure: (app, { upgradeWebSocket }) => {
|
||||
if (agentManager === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
app.get(
|
||||
'/_ssh_plexer',
|
||||
upgradeWebSocket((c) => {
|
||||
return agentManager.multiplexer!.websocketHandler(c);
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user