This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.littleshoot.proxy; | |
import io.netty.handler.codec.http.HttpRequest; | |
import io.netty.handler.codec.http.HttpResponse; | |
/** | |
* <p> | |
* This is based on some code from Marco Palladino that was giving him trouble. | |
* Use the below command to test: | |
* </p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this in place of the existing pathConnection defined in vis.js | |
$scope.pathConnection = function (peer) { | |
var pSelf = projection([model.location.lon, model.location.lat]), | |
pPeer = projection([peer.lon, peer.lat]), | |
xS = pSelf[0], yS = pSelf[1], xP = pPeer[0], yP = pPeer[1]; | |
var distanceBetweenPeers = Math.sqrt(Math.pow(xS - xP, 2) + Math.pow(yS - yP, 2)); | |
if (distanceBetweenPeers < 30) { | |
// Peer and self are very close, draw a loopy arc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lantern; | |
import java.awt.AWTException; | |
import java.awt.Image; | |
import java.awt.MenuItem; | |
import java.awt.PopupMenu; | |
import java.awt.TrayIcon; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.io.File; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Desktop; | |
import java.net.URI; | |
import java.net.URLEncoder; | |
public class TestMailto { | |
public static void main(String[] args) throws Exception { | |
String recipient = "ox@getlantern.org"; | |
String subject = URLEncoder | |
.encode("Join the Lantern Network to Circumvent Censorship"); | |
String body = URLEncoder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FTE-Powered echo server program | |
import socket | |
import fte | |
client_server_regex = '^GET\\ \\/([a-zA-Z0-9\\.\\/]*) HTTP/1\\.1\\r\\n\\r\\n$' | |
server_client_regex = '^HTTP/1\\.1\\ 200 OK\\r\\nContent-Type:\\ ([a-zA-Z0-9]+)\\r\\n\\r\\n\\C*$' | |
HOST = '' # Symbolic name meaning all available interfaces | |
PORT = 50008 # Arbitrary non-privileged port | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FTE-Powered echo client program | |
import socket | |
import fte | |
client_server_regex = '^GET\\ \\/([a-zA-Z0-9\\.\\/]*) HTTP/1\\.1\\r\\n\\r\\n$' | |
server_client_regex = '^HTTP/1\\.1\\ 200 OK\\r\\nContent-Type:\\ ([a-zA-Z0-9]+)\\r\\n\\r\\n\\C*$' | |
HOST = '127.0.0.1' # The remote host | |
PORT = 50007 # The same port as used by the server | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FTE-Powered echo client program | |
import socket | |
import fte | |
import random | |
import string | |
def random_string(size): | |
"""Return a random alphanumeric string of length ``size``.""" | |
chars = string.ascii_uppercase + string.digits | |
return ''.join(random.choice(chars) for x in range(size)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by protoc-gen-go. | |
// source: datum.proto | |
// DO NOT EDIT! | |
/* | |
Package sbenchmark is a generated protocol buffer package. | |
It is generated from these files: | |
datum.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This is a simple test of the stat server in flashlight --> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
var source = new EventSource('http://127.0.0.1:15670/'); | |
source.addEventListener('message', function(e) { | |
console.log(e.data); | |
}, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"net/http" |
OlderNewer