This page has been moved to https://github.com/int128/hello-envoy
This is an example of Envoy TCP Proxy from localhost:10000
to www.google.com:80
.
See also https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/listeners/tcp_proxy.
To run a proxy:
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 'vendor/tinygo' | |
const go = new Go(); | |
go.importObject.env['main.defineClass'] = function(namePtr, nameLen, cPtr, cGcPtr, pPtr/*, pGcPtr*/) { | |
const mem = new DataView(go._inst.exports.memory.buffer) | |
const decoder = new TextDecoder("utf-8"); | |
const name = decoder.decode(new DataView(go._inst.exports.memory.buffer, namePtr, nameLen)); | |
const constructorID = mem.getUint32(cPtr, true) |
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
//[email protected] wrote this file | |
/* | |
2 bytes string 1 byte string 1 byte | |
----------------------------------------------- | |
RRQ/ | 01/02 | Filename | 0 | Mode | 0 | | |
WRQ ----------------------------------------------- | |
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 ( | |
"encoding/json" | |
"fmt" | |
"os" | |
"reflect" | |
"strings" | |
) |
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
#!/usr/bin/env python3 | |
import subprocess | |
import json | |
import os | |
from pathlib import Path | |
import requests | |
from requests.compat import urljoin |
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
#!/bin/bash | |
# | |
# Digital Ocean Ubuntu 16.04.6 Droplet | |
# Please run these command before running the script | |
# apt update && apt full-upgrade -y && apt install -y qemu-utils pv | |
# | |
# wget script | |
# | |
# Run script | |
# chmod +x make-chr.sh |
NewerOlder