We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @verkehrsministerium/kraftfahrstrasse.AnonymousAuthProvider function in @verkehrsministerium/kraftfahrstrasse

To help you get started, we’ve selected a few @verkehrsministerium/kraftfahrstrasse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github verkehrsministerium / kraftfahrstrasse / example / performance.ts View on Github external
async function main() {
  const connection = new Connection({
    endpoint: ROUTER_ADDRESS,
    realm: 'realm1',

    serializer: new JSONSerializer(),
    transport: NodeWebSocketTransport,
    transportOptions: {
      perMessageDeflate: false,
    },
    authProvider: new AnonymousAuthProvider(),

    logFunction: (level: String, timestamp: Date, file: String, msg: String) => {
      if (level === 'INFO' || level === 'WARNING' || level === 'ERROR') {
        console.log(level, timestamp, file, msg);
      }
    },
  });
  console.log("opening");

  try {
    await connection.Open();
  } catch (err) {
    console.log(err);
    process.exit(1);
  }
github verkehrsministerium / kraftfahrstrasse / example / index.ts View on Github external
public reject: any;
  public resolve: any;
  constructor() {
    this.promise = new Promise((resolve, reject) => {
      this.resolve = resolve;
      this.reject = reject;
    });
  }
}

const connection = new Connection({
  endpoint: 'ws://localhost:8001/ws',
  serializer: new JSONSerializer(),
  transport: NodeWebSocketTransport,
  transportOptions: {},
  authProvider: new AnonymousAuthProvider(),
  logFunction: console.log as any,
  realm: 'realm1',
});

const main = async () => {
  await connection.Open();
  const sub = await connection.Subscribe('foo.baz', (args, kwargs, details) => {
    console.log('EVENT:', args, kwargs, details.publisher);
  }, {});
  console.log('Subscribed:', sub.ID());
  const handler = async (args, kwargs, details) => {
    console.log('Called with args:', args, kwargs, details);
    const pub = await connection.Publish('foo.baz', args, kwargs, {
      acknowledge: true,
      disclose_me: true,
      exclude_me: false,