Connection and credential options.
The live session.
import { connect } from 'edgeport/stomp';
await using stomp = await connect({
hostname: 'broker.example.com',
login: 'user',
passcode: 'secret'
});
await stomp.send('/queue/jobs', 'hello');
await using sub = stomp.subscribe('/queue/jobs');
for await (const msg of sub) {
console.log(new TextDecoder().decode(msg.body));
break;
}
Connects to a STOMP broker, performs the handshake, and returns a live session.
Dials the core transport (implicit TLS when
tls: 'implicit', otherwise plaintext optionally upgraded viastarttls), sendsCONNECTwithaccept-version,host,heart-beat, and anylogin/passcode, and waits forCONNECTED. AnERRORframe during connect surfaces as AuthError when it looks auth-related, otherwise ProtocolError. A background pump then routes messages and receipts.