Skip to content

Instantly share code, notes, and snippets.

View ibc's full-sized avatar

Iñaki Baz Castillo ibc

View GitHub Profile
@ibc
ibc / mediasoup-get-bindable-ip.ts
Created June 9, 2020 10:12
mediasoup v3: get bindable private IP
import * as os from 'os';
import * as dgram from 'dgram';
async function detectBindableIp(family: 'IPv4' | 'IPv6'): Promise<string> {
const ifaces = os.networkInterfaces();
// Iterate all network interfaces.
for (const iface of Object.keys(ifaces)) {
// Iterate all network addresses in each network interface.
for (const address of ifaces[iface]) {
@ibc
ibc / all-tests.sh
Last active December 9, 2019 10:59
Test node-sctp and mediasoup
#!/usr/bin/env bash
set -e
./node-sctp-mediasoup-test.js 1000
./node-sctp-mediasoup-test.js 1300
./node-sctp-mediasoup-test.js 5000
@ibc
ibc / Chrome.sh
Last active February 26, 2024 17:52
WebRTC debugging
/Google\ Chrome\ Canary --enable-logging --v=1 --vmodule=*/webrtc/*=2,*/libjingle/*=2,*=-2 --enable-logging=stderr
// Easier:
/Google\ Chrome\ Canary --enable-logging --v=1 --vmodule=*/webrtc/*=2,*=-2 --enable-logging=stderr
@ibc
ibc / get-sip-identities.rb
Created December 1, 2011 09:26
Script to get SIP identities from a TLS certificate following RFC 5922 section 7.1
#!/usr/bin/ruby
# Runs as follows:
#
# ~$ ruby get-sip-identities.rb PEM_FILE
require "openssl"
@ibc
ibc / tls-cert-generator.rb
Created November 9, 2011 20:37
Autosigned TLS Certificate Generator (including SubjectAltName fields for "URI:sip" and "DNS")
#!/usr/bin/ruby
# Runs as follows:
#
# ~$ ruby tls-cert-generator.rb
require "openssl"
require "socket"