Giter Club home page Giter Club logo

ministun's Introduction

ministun

Unit tests

STUN (Session Traversal Utilities for NAT) is a simple protocol. A STUN implementation should be simple too.

ministun is a zero dependency STUN server for Node.js. It implements "Basic Server Behavior" as defined by section 13 of RFC 5389, including backwards compatibility with RFC 3489.

Requirements

Node.js >= 12.14.0

Installation

npm i ministun

Usage

const Ministun = require("ministun");

const config = {
	udp4: true,
	udp6: true,
	port: 3478,
	log: console.log,
	err: console.err,
	sw: true
};

const server = new Ministun(config);

async function startServer() {
	await server.start();
}

async function stopServer() {
	await server.stop();
}

Configuration

  • udp4: bool (Default: true)
    Support UDP over IPv4?

  • udp6: bool (Default: true)
    Support UDP over IPv6?

  • port: number (Default: 3478)
    Port number

  • log: function || null (Default: console.log)
    Log messages will be passed to this function as arg 0, null = no message logging

  • err: function || null (Default: console.err)
    Error messages will be passed to this function as arg 0, null = no error logging

  • sw: bool (Default: true)
    Send the SOFTWARE attribute with response messages?

TODO

Better test coverage

ministun's People

Contributors

jessetane avatar noahlevenson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ministun's Issues

PRs welcome?

would you accept a PR which attempts lots of code coverage without changing src code?

Can't connect using stun in some cases that google's stun server can facilitate

I did a test with 3 different node.js stun servers: stun, node-stun, and ministun. All had the same properties on the cases I tested on. The case they all failed was when I tried to connect a phone on its mobile network to a desktop client (which was also the machine hosting the stun server and coordination server). This case worked fine when I used stun:stun.l.google.com:19302 however, so I'm not sure if there's some functionality these modules aren't implementing, if they all have similar bugs, or if something else is going on. In any case, it feels like a rather large hole in the abilities of all of these stun server modules and finding a way to support that case would be a great way to differentiate this module vs the rest.

Here's the code I was testing with, and a readme that detailed the cases and the restults for each module:

ministun-code.zip

I created similar issues on the other repos as well:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.