使用离子应用调试DTL

时间:2019-05-10 06:40:25

标签: multithreading ionic-framework dtls

在ionic应用程序/ javascript或TypeScript中

dtls-client调试。

const dtls = require('node-dtls-client').dtls

let options = {
      type: 'udp4',
      address: '10.42.0.1',
      port: 49191,
      psk: {},
      timeout: 1000,
      cipherSuites: [
        'TLS_PSK_WITH_AES_128_GCM_SHA256',
        'TLS_PSK_WITH_AES_256_GCM_SHA384'
        // 'TLS_PSK_WITH_3DES_EDE_CBC_SHA'
      ]
    };
    const socket = dtls.createSocket(options).on("connected", e => {
      console.log("dtls testing");
      const msg = new Buffer("message payload");
      socket.send(msg);
    })
  }

0 个答案:

没有答案