Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mq-p2p-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mq-p2p-client

MQ-P2P-Client

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

1.Run in OS service mode (Server mode):

./mq-p2p-client update-config agentId <yourname> or ./mq-p2p-client generate-id
./mq-p2p-client update-config SERVER https://peer-server.demo.mqsolutions.vn
./mq-p2p-client add-protocol <deviceId> <protocol> <local_port>
./mq-p2p-client startup

Example:

./mq-p2p-client ngochip-agent
./mq-p2p-client add-protocol camera01 127.0.0.1:22 8082
./mq-p2p-client startup

2.Run in SDK mode (client mode):

const PeerConnection = require('PeerConnection'); //import PeerConnection from 'mq-p2p-client'
const peer = new PeerConnection({
    agentId: "local-peer-id",
    peerId: "remote-peer-id",
    server: "https://peer-server.demo.mqsolutions.vn"
});
const result = await peer.createConnection();
const stream = peer.dial("127.0.0.1:8082");
    

3.Livestream with mq-p2p-stream server:

const videoElement = document.getElementById("video");
const PeerMediaStream = require('PeerMediaStream'); //import {PeerMediaStream} from 'mq-p2p-client'
await PeerMediaStream.connect({
        peer: peer, //peerConnection được khởi tạo ở bước trên.
        streamServer: "127.0.0.1:6002" //địa chỉ stream server theo remote IP. Mặc định là 127.0.0.1:6002, Optional.
        videoElement: videoElement, //video element
        cameraId: cameraId //ID của camera tại server stream.
});

Contact Ngoc Hip or MQ ICT Solutions for instructions on deploying: signal servers (mq-p2p-server), stream servers (mq-p2p-stream) and agent services (mq-p2p-agent).

Keywords

FAQs

Package last updated on 06 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc