Skip to content

Instantly share code, notes, and snippets.

@shinyoshiaki
shinyoshiaki / stuns
Created July 23, 2017 14:12 — forked from yetithefoot/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
@shinyoshiaki
shinyoshiaki / softether.sh
Last active February 12, 2018 08:56 — forked from bouroo/softether.sh
Install softether vpn server on ubuntu 16.04+
#!/usr/local/env bash
# Update system
apt-get update && apt-get -y upgrade
# Get build tools
apt-get -y install build-essential wget curl
# Get softether source
wget "http://jp.softether-download.com/files/softether/v4.25-9656-rtm-2018.01.15-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.25-9656-rtm-2018.01.15-linux-x64-64bit.tar.gz" -O /tmp/softether-vpnserver.tar.gz
@shinyoshiaki
shinyoshiaki / file0.txt
Last active January 31, 2019 02:07
React Hooksでobject(オブジェクト)を使うCustom Hooks(カスタムフック) ref: https://qiita.com/ShinYoshiaki/items/a60f8ff343a178f681c9
import { useState } from "react";
export default function useObject<T>(obj: T) {
const [state, setObj] = useState({ ...obj });
const setState = (next: Partial<T>) => {
setObj(prev => {
return { ...prev, ...next };
});
};
using Newtonsoft.Json;
using Quobject.SocketIoClientDotNet.Client;
using SimplePeerConnectionM;
using System.Collections.Generic;
namespace WebRTC
{
public class Signaling
{
// Browser sync program
import { uniqueId } from "lodash";
import React, { useState } from "react";
import ReactDOM from "react-dom";
type Cursor = number[];
type DeserializedMutationRecord =
| {
@shinyoshiaki
shinyoshiaki / index.stories.tsx
Last active March 10, 2019 09:15
path to json tree on react
import React from "react";
import { storiesOf } from "@storybook/react";
import Component, { Props } from ".";
const props: Props = {
paths: [
"src/test/1.ts",
"src/test/2.ts",
"src/components/index.tsx",
"src/components/atoms/index.tsx",
import { useState } from "react";
export function useLoading<A, B extends any[]>(
func: (...args: B) => Promise<A>
): [() => Promise<A | void>, boolean, string] {
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
const fetch = async (...args: B) => {
setLoading(true);
1. Introduction
RFC 3264 [RFC3264] defines a two-phase exchange of Session Description Protocol (SDP) messages [RFC4566] for the purposes of establishment of multimedia sessions. This offer/answer mechanism is used by protocols such as the Session Initiation Protocol (SIP) [RFC3261].
Protocols using offer/answer are difficult to operate through Network Address Translators (NATs). Because their purpose is to establish a flow of media packets, they tend to carry the IP addresses and ports of media sources and sinks within their messages, which is known to be problematic through NAT [RFC3235]. The protocols also seek to create a media flow directly between participants, so that there is no application layer intermediary between them. This is done to reduce media latency, decrease packet loss, and reduce the operational costs of deploying the application. However, this is difficult to accomplish through NAT. A full treatment of the reasons for this is beyond the scope of this specification.
Numerous
1.はじめに
RFC 3264 [RFC3264]は、マルチメディアセッションの確立を目的としたSession Description Protocol(SDP)メッセージの2フェーズ交換[RFC4566]を定義しています。このオファー/アンサーメカニズムは、セッション開始プロトコル(SIP)[RFC3261]などのプロトコルで使用されます。
オファー/アンサーを使用するプロトコルは、ネットワークアドレス変換器(NAT)を介して操作するのが困難です。メディアパケットのフローを確立することが目的であるため、メッセージ内でメディアソースおよびシンクのIPアドレスとポートを運ぶ傾向があります。これは、NAT [RFC3235]で問題があることが知られています。また、プロトコルは参加者間で直接メディアフローを作成しようとするため、参加者間にアプリケーションレイヤーの仲介はありません。これは、メディアの遅延を減らし、パケット損失を減らし、アプリケーションを展開する運用コストを削減するために行われます。ただし、これをNATで実現することは困難です。この理由の完全な取り扱いは、この仕様の範囲外です。
これらのプロトコルがNATを介して動作できるようにするための多数のソリューションが定義されています。これらには、アプリケーション層ゲートウェイ(ALG)、ミドルボックス制御プロトコル[RFC3303]、元のUDPスルーNAT(STUN)[RFC3489]仕様、およびレルム固有IP [RFC3102] [RFC3103]が必要なセッション記述拡張が含まれます。リアルタイム制御プロトコル(RTCP)[RFC3605]のセッション記述プロトコル(SDP)[RFC4566]属性など、それらを機能させます。残念ながら、これらの手法にはすべて長所と短所があり、ネットワークトポロジによっては最適化されますが、他のネットワークトポロジでは不十分な選択になります。その結果、管理者と実装者は、ソリューションが展開されるネットワークのトポロジについて推測を行っています。これは、システムに複雑さと脆弱性をもたらします。
この仕様は、オファー/アンサーモデルによって確立されたUDPベースのメディアストリーム(TCP [ICE-TCP]などの他のトランスポートプロトコルを処理するようにICEを拡張できます)のNATトラバーサルの技術として、Inte