Further updates for this repo

This commit is contained in:
Arlo Breault 2016-01-05 10:12:53 -08:00
parent 461324d36e
commit 8fbc50bec8
5 changed files with 17 additions and 10 deletions

2
.gitignore vendored
View file

@ -4,4 +4,4 @@
ignore/ ignore/
datadir/ datadir/
snowflake snowflake
webrtc-client.log snowflake.log

View file

@ -7,12 +7,12 @@ A Pluggable Transport using WebRTC
Open up four terminals: Open up four terminals:
1. tor -f torrc SOCKSPort auto 1. tor -f torrc SOCKSPort auto
2. tail -F webrtc-client.log 2. tail -F snowflake.log
3. cat > signal 3. cat > signal
4. open proxy/snowflake.html 4. open proxy/snowflake.html
Look for the offer in terminal 2; copy and paste it into the browswer window Look for the offer in terminal 2; copy and paste it into the browser window
opened from terminal 4. Copy and paste the answer from terminal 4 to terminal 3. opened from terminal 4. Copy and paste the browser to terminal 3.
At this point you should see some TLS garbage in the chat window. At this point you should see some TLS garbage in the chat window.
### More ### More

View file

@ -19,7 +19,9 @@ window.RTCIceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate;
window.RTCSessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription; window.RTCSessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription;
var pc; // PeerConnection var pc; // PeerConnection
var answer; var offer, answer;
var channel;
// Janky state machine // Janky state machine
var MODE = { var MODE = {
INIT: 0, INIT: 0,
@ -65,7 +67,6 @@ function welcome() {
} }
function start(initiator) { function start(initiator) {
username + ": " + msg;
log("Starting up RTCPeerConnection..."); log("Starting up RTCPeerConnection...");
pc = new PeerConnection(config, { pc = new PeerConnection(config, {
optional: [ optional: [
@ -211,6 +212,12 @@ function prepareDataChannel(channel) {
} }
} }
function startChat() {
currentMode = MODE.CHAT;
$chatlog.className = "active";
log("------- chat enabled! -------");
}
// Get DOM elements and setup interactions. // Get DOM elements and setup interactions.
function init() { function init() {
console.log("loaded"); console.log("loaded");

View file

@ -254,7 +254,7 @@ func readSignalingMessages(f *os.File) {
func main() { func main() {
var err error var err error
logFile, err = os.OpenFile("webrtc-client.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600) logFile, err = os.OpenFile("snowflake.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -292,7 +292,7 @@ func main() {
listeners := make([]net.Listener, 0) listeners := make([]net.Listener, 0)
for _, methodName := range ptInfo.MethodNames { for _, methodName := range ptInfo.MethodNames {
switch methodName { switch methodName {
case "webrtc": case "snowflake":
ln, err := pt.ListenSocks("tcp", "127.0.0.1:0") ln, err := pt.ListenSocks("tcp", "127.0.0.1:0")
if err != nil { if err != nil {
pt.CmethodError(methodName, err.Error()) pt.CmethodError(methodName, err.Error())

4
torrc
View file

@ -1,5 +1,5 @@
UseBridges 1 UseBridges 1
DataDirectory datadir DataDirectory datadir
ClientTransportPlugin webrtc exec ./snowflake ClientTransportPlugin snowflake exec ./snowflake
Bridge webrtc 0.0.3.0:1 Bridge snowflake 0.0.3.0:1