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/
datadir/
snowflake
webrtc-client.log
snowflake.log

View file

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

View file

@ -19,7 +19,9 @@ window.RTCIceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate;
window.RTCSessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription;
var pc; // PeerConnection
var answer;
var offer, answer;
var channel;
// Janky state machine
var MODE = {
INIT: 0,
@ -65,7 +67,6 @@ function welcome() {
}
function start(initiator) {
username + ": " + msg;
log("Starting up RTCPeerConnection...");
pc = new PeerConnection(config, {
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.
function init() {
console.log("loaded");

View file

@ -254,7 +254,7 @@ func readSignalingMessages(f *os.File) {
func main() {
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 {
log.Fatal(err)
}
@ -292,7 +292,7 @@ func main() {
listeners := make([]net.Listener, 0)
for _, methodName := range ptInfo.MethodNames {
switch methodName {
case "webrtc":
case "snowflake":
ln, err := pt.ListenSocks("tcp", "127.0.0.1:0")
if err != nil {
pt.CmethodError(methodName, err.Error())

4
torrc
View file

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