npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

com.adrenak.airpeer

v1.3.0

Published

A WebRTC based networking plugin for Unity

Downloads

138

Readme

AirPeer

A WebRTC based networking plugin for Unity3D.

AirPeer allows Unity applications to communicate in a peer to peer manner using WebRTC technology.

Built on top of Christoph Kutza's WebRTC Network project with added features such as

  • Differentiating peers into server and clients to form star networks with server at the center.
  • For client to client communication (via server).
  • Event based API.
  • Message (de)serialization features.

Installation

AirPeer is distributed as a UPM package. There are many ways to install AirPeer. Here are 5 of them:

  1. Packages>manifest.json file
  • Easiest method for most people.
  • Ensure you have NPMJS registry in manifest.json inside the "scopedRegistries" object and under the scopes com.adrenak.airpeer is added. Then add the package as a project dependency. Make sure "dependencies" array has this the package name. If done right your manifest.json should resemble this. Substitute x.x.x with the version of AirPeer that you want in your project :
        {
            "dependencies": {
                "com.adrenak.airpeer": "x.x.x"
                <<other dependencies of your project>>
            },
            "scopedRegistries": [
                {
                    "name": "npmjs",
                    "url": "https://registry.npmjs.com",
                    "scopes": [
                        "com.adrenak.airpeer",
                        <<other packages from npmjs registry>>
                    ]
                },
                <<Other scoped registries, if any>>
            ]
        }
  1. Git clone method. Clone this repository. Then do either of these

    • Copy Assets/Adrenak.AirPeer into your projects Assets or Packages folder

    • Checkout the upm branch in the cloned repository using git checkout upm. Go to Unity>Window>Package Manager. Click on the + button in the top left corner>Add package from disk... and select Assets/Adrenak.AirPeer/package.json inside the cloned repository.

      This approach also allows you to change the version of AirPeer by doing a git checkout inside the cloned repository to a specific version and also lets you fetch the latest updates using git pull origin upm.

      If you know basic git and don't know much about upm, this is a good approach.

  2. OpenUPM:

    • AirPeer is available on NPM and OpenUPM registries. If you're using the OpenUPM CLI type any of these in the terminal:

      • openupm add com.adrenak.airpeer which will install it using the OpenUPM registry
      • openupm add --registry https://registry.npmjs.com com.adrenak.airpeer which will install it using the NPM registry.

      If you know UPM and use OpenUPM CLI, this method is the best.

  3. Via Git URL in Unity Package Manager:

    • Press the + button in package manager and add the URL https://github.com/adrenak/airpeer.git#upm.
  4. Github releases:

    • Go to https://github.com/adrenak/airpeer/tags and click on any upm/x.x.x where x.x.x is the version of AirPeer. You can download the zip and extract inside your projects Packages folder.

Documentation

Manual and tutorials is WIP. In the meantime, please refer to codedoc generated documentation here.

Samples

AirPeers comes with a couple of handy samples that show how you can connect to a WebRTC network and exchange messages. To import samples, go to Window>Package Manager. Find Adrenak.AirPeer and install Samples from the options on the right hand side of the window.

Signalling Server

A Signalling server implementation can be found in the AirSignal repository.

The samples in the AirPeer repository use an IP:Port that I am hosting, but it is neither garunteed to be online nor secure.

It is HIGHLY advised that you run AirSignal (or your own WebRTC signalling server implementation) on your own server and don't rely on my server. AirSignal can also be run locally localhost for easier testing.

Editor testing

Use ParellSync to use the samples within the Unity editor.

Connectivity issues

A major issue right now is that often two peers fail to connect. The problem is supposedly because of NAT failure.

The plugins on which AirPeer operates are old and their source code is not open for editir. Refactoring AirPeer to make APNetwork an abstraction is planned.

This would then be used to make Unity's WebRTC, which is more robust, the underlying networking plugin. An abstract APNetwork would also mean that APNode can use different WebRTC implementations, such as the MixedReality-WebRTC or custom ones.

Contact

This repository is made by Vatsal Ambastha and is under the MIT license.

Feel free to get in touch for helping support this project. As well as for commercial consultation/development in your own projects.

@github @website @twitter