First commit merge

This commit is contained in:
kbe
2025-10-09 16:37:02 +02:00
parent 915ef14fc5
commit 5aae456ab3
20 changed files with 2584 additions and 2 deletions

29
demo.js Normal file
View File

@@ -0,0 +1,29 @@
const Srf = require("drachtio-srf");
const srf = new Srf();
srf.connect({
host: "127.0.0.1",
port: 9022,
secret: "cymru"
});
srf.on("connect", (err, hostport) => {
console.log(`connected to a drachtio server listening on: ${hostport}`);
});
srf.register((req, res) => {
res.send(486, "So sorry, busy right now", {
headers: {
"X-Proudly-Served-By": "because why not?"
}
});
});
srf.invite((req, res) => {
res.send(486, "So sorry, busy right now", {
headers: {
"X-Custom-Header": "because why not?"
}
});
});