Function: createChannelEndpoint()
Makaio Framework / bus-core / createChannelEndpoint
Function: createChannelEndpoint()
Section titled “Function: createChannelEndpoint()”createChannelEndpoint(
context,endpointName,callback,options):ChannelEndpoint
Defined in: ../../../packages/bus-core/src/channel/channel-endpoint.ts:66
Register a channel endpoint that accepts encrypted point-to-point connections.
Listens for system.channel.open requests. When a request arrives for this
endpoint name with the correct token:
- Performs the ECDH key exchange (generates a keypair, derives the shared secret).
- Instantiates an IDirectChannel for the endpoint side.
- Calls
callbackso the endpoint can register its channel-scoped handlers. - Returns the channel ID and the endpoint public key to the client.
Multiple endpoints can coexist on the same bus context; each handles only
requests whose payload.endpoint matches its own name.
Parameters
Section titled “Parameters”context
Section titled “context”Bus context to register the endpoint handler on
endpointName
Section titled “endpointName”string
Logical name for this endpoint (e.g., ‘credentials’)
callback
Section titled “callback”(channel) => void
Called with the new IDirectChannel once the handshake is complete; use this to register channel handlers before the client receives the handshake response
options
Section titled “options”Endpoint options including the shared capability token
Returns
Section titled “Returns”A ChannelEndpoint handle whose close() unregisters the endpoint