diff --git a/clientcore/unbounded.go b/clientcore/broflake.go similarity index 78% rename from clientcore/unbounded.go rename to clientcore/broflake.go index e74813ad..6f650177 100644 --- a/clientcore/unbounded.go +++ b/clientcore/broflake.go @@ -1,4 +1,4 @@ -// unbounded.go defines mid-layer abstractions for constructing and describing a BU instance +// broflake.go defines mid-layer abstractions for constructing and describing a Broflake instance package clientcore import ( @@ -6,42 +6,42 @@ import ( "runtime" "sync" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/common" ) -type BUEngine struct { +type BroflakeEngine struct { cTable *WorkerTable pTable *WorkerTable ui UI wg *sync.WaitGroup } -func NewBUEngine(cTable, pTable *WorkerTable, ui UI, wg *sync.WaitGroup) *BUEngine { - return &BUEngine{cTable, pTable, ui, wg} +func NewBroflakeEngine(cTable, pTable *WorkerTable, ui UI, wg *sync.WaitGroup) *BroflakeEngine { + return &BroflakeEngine{cTable, pTable, ui, wg} } -func (b *BUEngine) start() { +func (b *BroflakeEngine) start() { b.cTable.Start() b.pTable.Start() - common.Debug("▶ BU started!") + common.Debug("▶ Broflake started!") } -func (b *BUEngine) stop() { +func (b *BroflakeEngine) stop() { b.cTable.Stop() b.pTable.Stop() go func() { b.wg.Wait() - common.Debug("■ BU stopped.") + common.Debug("■ Broflake stopped.") b.ui.OnReady() }() } -func (b *BUEngine) debug() { +func (b *BroflakeEngine) debug() { common.Debugf("NumGoroutine: %v", runtime.NumGoroutine()) } -func NewBU(bfOpt *BUOptions, rtcOpt *WebRTCOptions, egOpt *EgressOptions) (bfconn *BUConn, ui *UIImpl, err error) { +func NewBroflake(bfOpt *BroflakeOptions, rtcOpt *WebRTCOptions, egOpt *EgressOptions) (bfconn *BroflakeConn, ui *UIImpl, err error) { if bfOpt.ClientType != "desktop" && bfOpt.ClientType != "widget" { err = fmt.Errorf("Invalid clientType '%v\n'", bfOpt.ClientType) common.Debugf(err.Error()) @@ -56,7 +56,7 @@ func NewBU(bfOpt *BUOptions, rtcOpt *WebRTCOptions, egOpt *EgressOptions) (bfcon var wgReady sync.WaitGroup if bfOpt == nil { - bfOpt = NewDefaultBUOptions() + bfOpt = NewDefaultBroflakeOptions() } if rtcOpt == nil { @@ -68,7 +68,7 @@ func NewBU(bfOpt *BUOptions, rtcOpt *WebRTCOptions, egOpt *EgressOptions) (bfcon } // The boot DAG: - // build cTable/pTable -> build the BU struct -> run ui.Init -> set up the bus and bind + // build cTable/pTable -> build the Broflake struct -> run ui.Init -> set up the bus and bind // the upstream/downstream handlers -> build cRouter/pRouter -> start the bus, init the routers, // call onStartup and onReady. This dependency graph currently requires us to implement two // switches on clientType during the boot process, which can probably be improved upon. @@ -104,11 +104,11 @@ func NewBU(bfOpt *BUOptions, rtcOpt *WebRTCOptions, egOpt *EgressOptions) (bfcon pTable = NewWorkerTable(pfsms) } - // Step 2: Build BU - unbounded := NewBUEngine(cTable, pTable, ui, &wgReady) + // Step 2: Build Broflake + broflake := NewBroflakeEngine(cTable, pTable, ui, &wgReady) // Step 3: Init the UI (this constructs and exposes the JavaScript API as required) - ui.Init(unbounded) + ui.Init(broflake) // Step 4: Set up the bus, bind upstream and downstream UI handlers var bus = NewIpcObserver( diff --git a/clientcore/consumer.go b/clientcore/consumer.go index 34337ba0..2ce07f3d 100644 --- a/clientcore/consumer.go +++ b/clientcore/consumer.go @@ -18,8 +18,8 @@ import ( "sync" "time" - "github.com/getlantern/unbounded/common" - "github.com/getlantern/unbounded/otel" + "github.com/getlantern/broflake/common" + "github.com/getlantern/broflake/otel" "github.com/pion/webrtc/v3" ) diff --git a/clientcore/egress_consumer.go b/clientcore/egress_consumer.go index dc32446f..f21ce529 100644 --- a/clientcore/egress_consumer.go +++ b/clientcore/egress_consumer.go @@ -11,7 +11,7 @@ import ( "nhooyr.io/websocket" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/common" ) func NewEgressConsumerWebSocket(options *EgressOptions, wg *sync.WaitGroup) *WorkerFSM { diff --git a/clientcore/producer.go b/clientcore/producer.go index 2e2907e8..67a58ae7 100644 --- a/clientcore/producer.go +++ b/clientcore/producer.go @@ -18,7 +18,7 @@ import ( "github.com/pion/webrtc/v3" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/common" ) func NewProducerWebRTC(options *WebRTCOptions, wg *sync.WaitGroup) *WorkerFSM { diff --git a/clientcore/protocol.go b/clientcore/protocol.go index 0aa1d899..724741eb 100644 --- a/clientcore/protocol.go +++ b/clientcore/protocol.go @@ -7,7 +7,7 @@ import ( "math/rand" "sync" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/common" ) const ( diff --git a/clientcore/quic.go b/clientcore/quic.go index ac9546e5..bdc57281 100644 --- a/clientcore/quic.go +++ b/clientcore/quic.go @@ -11,7 +11,7 @@ import ( "github.com/quic-go/quic-go" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/common" ) type ReliableStreamLayer interface { @@ -38,13 +38,13 @@ type QUICLayerOptions struct { CA *x509.CertPool } -func NewQUICLayer(bfconn *BUConn, qopt *QUICLayerOptions) (*QUICLayer, error) { +func NewQUICLayer(bfconn *BroflakeConn, qopt *QUICLayerOptions) (*QUICLayer, error) { q := &QUICLayer{ bfconn: bfconn, tlsConfig: &tls.Config{ ServerName: qopt.ServerName, InsecureSkipVerify: qopt.InsecureSkipVerify, - NextProtos: []string{"unbounded"}, + NextProtos: []string{"broflake"}, RootCAs: qopt.CA, }, eventualConn: newEventualConn(), @@ -54,7 +54,7 @@ func NewQUICLayer(bfconn *BUConn, qopt *QUICLayerOptions) (*QUICLayer, error) { } type QUICLayer struct { - bfconn *BUConn + bfconn *BroflakeConn tlsConfig *tls.Config eventualConn *eventualConn mx sync.RWMutex diff --git a/clientcore/routing.go b/clientcore/routing.go index a957af45..669a63e6 100644 --- a/clientcore/routing.go +++ b/clientcore/routing.go @@ -4,7 +4,7 @@ package clientcore import ( "sync" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/common" ) // A tableRouter is a multiplexer/demultiplexer which functions as the interface to a WorkerTable, diff --git a/clientcore/settings.go b/clientcore/settings.go index 2e359f69..7163939b 100644 --- a/clientcore/settings.go +++ b/clientcore/settings.go @@ -54,7 +54,7 @@ func NewDefaultEgressOptions() *EgressOptions { } } -type BUOptions struct { +type BroflakeOptions struct { ClientType string CTableSize int PTableSize int @@ -62,8 +62,8 @@ type BUOptions struct { Netstated string } -func NewDefaultBUOptions() *BUOptions { - return &BUOptions{ +func NewDefaultBroflakeOptions() *BroflakeOptions { + return &BroflakeOptions{ ClientType: "desktop", CTableSize: 5, PTableSize: 5, diff --git a/clientcore/ui.go b/clientcore/ui.go index daf78696..4389f56c 100644 --- a/clientcore/ui.go +++ b/clientcore/ui.go @@ -7,8 +7,8 @@ import ( "sync/atomic" "time" - "github.com/getlantern/unbounded/common" - netstatecl "github.com/getlantern/unbounded/netstate/client" + "github.com/getlantern/broflake/common" + netstatecl "github.com/getlantern/broflake/netstate/client" ) const ( @@ -16,7 +16,7 @@ const ( ) type UI interface { - Init(bu *BUEngine) + Init(bf *BroflakeEngine) Start() diff --git a/clientcore/ui_default_impl.go b/clientcore/ui_default_impl.go index f29e6f08..098834e0 100644 --- a/clientcore/ui_default_impl.go +++ b/clientcore/ui_default_impl.go @@ -9,23 +9,23 @@ import ( type UIImpl struct { UI - BUEngine *BUEngine + BroflakeEngine *BroflakeEngine } -func (ui *UIImpl) Init(bu *BUEngine) { - ui.BUEngine = bu +func (ui *UIImpl) Init(bf *BroflakeEngine) { + ui.BroflakeEngine = bf } func (ui UIImpl) Start() { - ui.BUEngine.start() + ui.BroflakeEngine.start() } func (ui UIImpl) Stop() { - ui.BUEngine.stop() + ui.BroflakeEngine.stop() } func (ui UIImpl) Debug() { - ui.BUEngine.debug() + ui.BroflakeEngine.debug() } func (ui UIImpl) OnReady() { @@ -33,7 +33,7 @@ func (ui UIImpl) OnReady() { } func (ui UIImpl) OnStartup() { - ui.BUEngine.start() + ui.BroflakeEngine.start() } func (ui UIImpl) OnDownstreamChunk(size int, workerIdx int) { diff --git a/clientcore/ui_wasm_impl.go b/clientcore/ui_wasm_impl.go index 8da3611a..a70e6835 100644 --- a/clientcore/ui_wasm_impl.go +++ b/clientcore/ui_wasm_impl.go @@ -13,17 +13,17 @@ import ( type UIImpl struct { UI - BUEngine *BUEngine - ID string + BroflakeEngine *BroflakeEngine + ID string } -func (ui *UIImpl) Init(bu *BUEngine) { - ui.BUEngine = bu +func (ui *UIImpl) Init(bf *BroflakeEngine) { + ui.BroflakeEngine = bf // The notion of 'ID' exists solely to avoid collisions in the JS namespace ui.ID = strings.Replace("L4NT3RN"+uuid.NewString(), "-", "", -1) - // Construct the JavaScript API for this BU instance + // Construct the JavaScript API for this Broflake instance js.Global().Set(ui.ID, js.Global().Get("EventTarget").New()) js.Global().Get(ui.ID).Set( @@ -43,15 +43,15 @@ func (ui *UIImpl) Init(bu *BUEngine) { } func (ui UIImpl) Start() { - ui.BUEngine.start() + ui.BroflakeEngine.start() } func (ui UIImpl) Stop() { - ui.BUEngine.stop() + ui.BroflakeEngine.stop() } func (ui UIImpl) Debug() { - ui.BUEngine.debug() + ui.BroflakeEngine.debug() } func (ui UIImpl) fireEvent(eventName string, detail map[string]interface{}) { diff --git a/clientcore/user.go b/clientcore/user.go index 8b629a74..148dd096 100644 --- a/clientcore/user.go +++ b/clientcore/user.go @@ -13,28 +13,28 @@ import ( "github.com/google/uuid" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/common" ) -type BUConn struct { +type BroflakeConn struct { net.PacketConn writeChan chan IPCMsg readChan chan IPCMsg addr common.DebugAddr } -func (c BUConn) LocalAddr() net.Addr { +func (c BroflakeConn) LocalAddr() net.Addr { return c.addr } -func (c BUConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { +func (c BroflakeConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { msg := <-c.readChan payload := msg.Data.([]byte) copy(p, payload) return len(payload), common.DebugAddr("DEBUG NELSON WUZ HERE"), nil } -func (c BUConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { +func (c BroflakeConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { // TODO: This copy seems necessary to avoid a data race b := make([]byte, len(p)) copy(b, p) @@ -49,7 +49,7 @@ func (c BUConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { return len(b), nil } -func NewProducerUserStream(wg *sync.WaitGroup) (*BUConn, *WorkerFSM) { +func NewProducerUserStream(wg *sync.WaitGroup) (*BroflakeConn, *WorkerFSM) { worker := NewWorkerFSM(wg, []FSMstate{ FSMstate(func(ctx context.Context, com *ipcChan, input []interface{}) (int, []interface{}) { // State 0 @@ -60,12 +60,12 @@ func NewProducerUserStream(wg *sync.WaitGroup) (*BUConn, *WorkerFSM) { }), }) - buconn := BUConn{ + bfconn := BroflakeConn{ PacketConn: &net.UDPConn{}, writeChan: worker.com.tx, readChan: worker.com.rx, addr: common.DebugAddr(uuid.NewString()), } - return &buconn, worker + return &bfconn, worker } diff --git a/cmd/client_default_impl.go b/cmd/client_default_impl.go index 17f53d09..ec3d1b46 100644 --- a/cmd/client_default_impl.go +++ b/cmd/client_default_impl.go @@ -9,8 +9,8 @@ import ( _ "net/http/pprof" "os" - "github.com/getlantern/unbounded/clientcore" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/clientcore" + "github.com/getlantern/broflake/common" ) var ( @@ -30,7 +30,7 @@ func main() { proxyPort = "1080" } - common.Debugf("Welcome to Browsers Unbounded %v", common.Version) + common.Debugf("Welcome to Broflake %v", common.Version) common.Debugf("clientType: %v", clientType) common.Debugf("freddie: %v", freddie) common.Debugf("egress: %v", egress) @@ -41,7 +41,7 @@ func main() { common.Debugf("serverName: %v", serverName) common.Debugf("proxyPort: %v", proxyPort) - bfOpt := clientcore.NewDefaultBUOptions() + bfOpt := clientcore.NewDefaultBroflakeOptions() bfOpt.ClientType = clientType bfOpt.Netstated = netstated @@ -63,7 +63,7 @@ func main() { egOpt.Addr = egress } - bfconn, _, err := clientcore.NewBU(bfOpt, rtcOpt, egOpt) + bfconn, _, err := clientcore.NewBroflake(bfOpt, rtcOpt, egOpt) if err != nil { log.Fatal(err) } diff --git a/cmd/client_wasm_impl.go b/cmd/client_wasm_impl.go index 620e462f..c1824cb7 100644 --- a/cmd/client_wasm_impl.go +++ b/cmd/client_wasm_impl.go @@ -6,8 +6,8 @@ package main import ( "syscall/js" - "github.com/getlantern/unbounded/clientcore" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/clientcore" + "github.com/getlantern/broflake/common" ) func main() { @@ -16,12 +16,12 @@ func main() { // A constructor is exposed to JS. Some (but not all) defaults are forcibly overridden by passing // args. You *must* pass valid values for all of these args: // - // newBU( - // BUOptions.ClientType, - // BUOptions.CTableSize, - // BUOptions.PTableSize, - // BUOptions.BusBufferSz, - // BUOptions.Netstated, + // newBroflake( + // BroflakeOptions.ClientType, + // BroflakeOptions.CTableSize, + // BroflakeOptions.PTableSize, + // BroflakeOptions.BusBufferSz, + // BroflakeOptions.Netstated, // WebRTCOptions.DiscoverySrv // WebRTCOptions.Endpoint, // WebRTCOptions.STUNBatchSize, @@ -30,11 +30,11 @@ func main() { // EgressOptions.Endpoint // ) // - // Returns a reference to a BU JS API impl (defined in ui_wasm_impl.go) + // Returns a reference to a Broflake JS API impl (defined in ui_wasm_impl.go) js.Global().Set( - "newBU", + "newBroflake", js.FuncOf(func(this js.Value, args []js.Value) interface{} { - bfOpt := clientcore.BUOptions{ + bfOpt := clientcore.BroflakeOptions{ ClientType: args[0].String(), CTableSize: args[1].Int(), PTableSize: args[2].Int(), @@ -52,13 +52,13 @@ func main() { egOpt.Addr = args[9].String() egOpt.Endpoint = args[10].String() - _, ui, err := clientcore.NewBU(&bfOpt, rtcOpt, egOpt) + _, ui, err := clientcore.NewBroflake(&bfOpt, rtcOpt, egOpt) if err != nil { - common.Debugf("newBU error: %v", err) + common.Debugf("newBroflake error: %v", err) return nil } - common.Debugf("Built new BU API: %v", ui.ID) + common.Debugf("Built new Broflake API: %v", ui.ID) return js.Global().Get(ui.ID) }), ) diff --git a/cmd/dist/public/index.html b/cmd/dist/public/index.html index 14d80bba..01f0e15a 100644 --- a/cmd/dist/public/index.html +++ b/cmd/dist/public/index.html @@ -8,7 +8,7 @@ .then((result) => { go.run(result.instance); - newBU( + newBroflake( "widget", 5, 5, diff --git a/cmd/proxy.go b/cmd/proxy.go index 32a71ed0..8a3957f3 100644 --- a/cmd/proxy.go +++ b/cmd/proxy.go @@ -10,15 +10,15 @@ import ( "github.com/elazarl/goproxy" - "github.com/getlantern/unbounded/clientcore" - "github.com/getlantern/unbounded/common" + "github.com/getlantern/broflake/clientcore" + "github.com/getlantern/broflake/common" ) const ( ip = "127.0.0.1" ) -func runLocalProxy(port string, bfconn *clientcore.BUConn, ca, sn string) { +func runLocalProxy(port string, bfconn *clientcore.BroflakeConn, ca, sn string) { // TODO: this is just to prevent a race with client boot processes, it's not worth getting too // fancy with an event-driven solution because the local proxy is all mocked functionality anyway <-time.After(2 * time.Second) diff --git a/cmd/wmaker.sh b/cmd/wmaker.sh index 91ed326c..d7fb8e29 100755 --- a/cmd/wmaker.sh +++ b/cmd/wmaker.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# XXX: We assume this script was executed from unbounded/cmd! +# XXX: We assume this script was executed from broflake/cmd! set -e set -u @@ -10,7 +10,7 @@ REMOTE_PORT="22" REMOTE_USERNAME="root" REMOTE_BASE_DIR="/usr/share/nginx/html" -# XXX: Relative to unbounded/cmd! +# XXX: Relative to broflake/cmd! BUILD_PATH="/dist/wmaker" # Don't mess with these @@ -20,7 +20,7 @@ OUTPUT_DIR="$(pwd)${BUILD_PATH}/${UNIX_TIME}" # UI environment variables # XXX: If stuff's broken, make sure that these reflect the current and complete set of environment -# variables defined by the UI. See the .env files in /unbounded/ui! +# variables defined by the UI. See the .env files in /broflake/ui! # export REACT_APP_WIDGET_WASM_URL="/widget.wasm" # export PUBLIC_URL="/" # export REACT_APP_STORAGE_URL="/storage.html" @@ -172,11 +172,11 @@ echo " w:::::w w:::::w m::::m m::::m m::::ma:::::aaaa: echo " w:::w w:::w m::::m m::::m m::::m a::::::::::aa:::ak::::::k k:::::kee:::::::::::::e r:::::r " echo " www www mmmmmm mmmmmm mmmmmm aaaaaaaaaa aaaakkkkkkkk kkkkkkk eeeeeeeeeeeeee rrrrrrr " echo "" -echo "Welcome to wmaker... The Fastest Way to Create and Deploy a Test Build of the Browsers Unbounded Widget!™" +echo "Welcome to wmaker... The Fastest Way to Create and Deploy a Test Build of the Broflake Widget!™" echo "" echo "We'll build a widget from the current branch..." echo "" -echo -e "--> unbounded: ${COL_IPURPLE}$(pwd)${COL_WHITE} (${BROFLAKE_COMMIT_HASH}, ${BROFLAKE_COMMIT_COLOR}${BROFLAKE_COMMIT_STATUS}${COL_WHITE})" +echo -e "--> broflake: ${COL_IPURPLE}$(pwd)${COL_WHITE} (${BROFLAKE_COMMIT_HASH}, ${BROFLAKE_COMMIT_COLOR}${BROFLAKE_COMMIT_STATUS}${COL_WHITE})" echo "" echo -e "Build ${COL_IYELLOW}# ${UNIX_TIME} ${COL_WHITE}will output to:" echo "" diff --git a/common/log.go b/common/log.go index 995341ec..7141e5ac 100644 --- a/common/log.go +++ b/common/log.go @@ -11,7 +11,7 @@ var ( logMx sync.RWMutex ) -// Override the Logger used by BU for debug messages +// Override the Logger used by broflake for debug messages func SetDebugLogger(l *log.Logger) { logMx.Lock() defer logMx.Unlock() diff --git a/egress/cmd/egress.go b/egress/cmd/egress.go index 2404588e..3bbd3a2c 100644 --- a/egress/cmd/egress.go +++ b/egress/cmd/egress.go @@ -10,8 +10,8 @@ import ( "github.com/elazarl/goproxy" - "github.com/getlantern/unbounded/common" - "github.com/getlantern/unbounded/egress" + "github.com/getlantern/broflake/common" + "github.com/getlantern/broflake/egress" ) func main() { @@ -64,7 +64,7 @@ func main() { common.Debug("HTTP proxy just saw a request:") // TODO: overriding the context is a hack to prevent "context canceled" errors when proxying // HTTP (not HTTPS) requests. It's not yet clear why this is necessary -- it may be a quirk - // of elazarl/goproxy. See: https://github.com/getlantern/unbounded/issues/47 + // of elazarl/goproxy. See: https://github.com/getlantern/broflake/issues/47 r = r.WithContext(context.Background()) common.Debug(r) return r, nil diff --git a/egress/egresslib.go b/egress/egresslib.go index c0df54e7..19f23757 100644 --- a/egress/egresslib.go +++ b/egress/egresslib.go @@ -21,8 +21,8 @@ import ( "go.opentelemetry.io/otel/metric" "nhooyr.io/websocket" + "github.com/getlantern/broflake/common" "github.com/getlantern/telemetry" - "github.com/getlantern/unbounded/common" ) // TODO: rate limiters and fancy settings and such: @@ -66,7 +66,7 @@ func (q websocketPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error // and reconnections on idle WebSockets, and so it's worth asking whether the cycles added by this // keepalive logic are worth the overhead we're saving in reduced discon/recon loops. Ultimately, // we'd rather implement keepalive on the client side, but that's a much bigger lift. See: - // https://github.com/getlantern/unbounded/issues/127 + // https://github.com/getlantern/broflake/issues/127 readDone := make(chan struct{}) go func() { @@ -147,7 +147,7 @@ func generateTLSConfig() *tls.Config { } return &tls.Config{ Certificates: []tls.Certificate{tlsCert}, - NextProtos: []string{"unbounded"}, + NextProtos: []string{"broflake"}, } } @@ -155,7 +155,7 @@ func (l proxyListener) handleWebsocket(w http.ResponseWriter, r *http.Request) { // TODO: InsecureSkipVerify=true just disables origin checking, we need to instead add origin // patterns as strings using AcceptOptions.OriginPattern // TODO: disabling compression is a workaround for a WebKit bug: - // https://github.com/getlantern/unbounded/issues/45 + // https://github.com/getlantern/broflake/issues/45 c, err := websocket.Accept( w, r, @@ -237,7 +237,7 @@ func (l proxyListener) handleWebsocket(w http.ResponseWriter, r *http.Request) { func NewListener(ctx context.Context, ll net.Listener, certPEM, keyPEM string) (net.Listener, error) { closeFuncMetric := telemetry.EnableOTELMetrics(ctx) - m := otel.Meter("github.com/getlantern/unbounded/egress") + m := otel.Meter("github.com/getlantern/broflake/egress") var err error nClientsCounter, err = m.Int64UpDownCounter("concurrent-websockets") if err != nil { @@ -283,13 +283,13 @@ func NewListener(ctx context.Context, ll net.Listener, certPEM, keyPEM string) ( if certPEM != "" && keyPEM != "" { cert, err := tls.X509KeyPair([]byte(certPEM), []byte(keyPEM)) if err != nil { - return nil, fmt.Errorf("Unable to load cert/key from PEM for Browsers Unbounded: %v", err) + return nil, fmt.Errorf("Unable to load cert/key from PEM for broflake: %v", err) } - common.Debugf("Browsers Unbounded using cert %v and key %v", certPEM, keyPEM) + common.Debugf("Broflake using cert %v and key %v", certPEM, keyPEM) tlsConfig = &tls.Config{ Certificates: []tls.Certificate{cert}, - NextProtos: []string{"unbounded"}, + NextProtos: []string{"broflake"}, } } else { common.Debugf("!!! WARNING !!! No certfile and/or keyfile specified, generating an insecure TLSConfig!") diff --git a/freddie/freddie.go b/freddie/freddie.go index e5bb8b9e..95bb2987 100644 --- a/freddie/freddie.go +++ b/freddie/freddie.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/otel/metric" "golang.org/x/mod/semver" + "github.com/getlantern/broflake/common" "github.com/getlantern/telemetry" - "github.com/getlantern/unbounded/common" ) const ( @@ -213,8 +213,8 @@ func enableCors(w *http.ResponseWriter) { (*w).Header().Set("Access-Control-Allow-Origin", "*") } -// Validate the BU protocol version header. If the header isn't present, we consider you -// invalid. Protocol version is currently the major version of BU's reference implementation +// Validate the Broflake protocol version header. If the header isn't present, we consider you +// invalid. Protocol version is currently the major version of Broflake's reference implementation func isValidProtocolVersion(r *http.Request) bool { if semver.Major(r.Header.Get(common.VersionHeader)) != semver.Major(common.Version) { return false @@ -233,7 +233,7 @@ func main() { closeFuncMetric := telemetry.EnableOTELMetrics(ctx) defer func() { _ = closeFuncMetric(ctx) }() - m := otel.Meter("github.com/getlantern/unbounded/freddie") + m := otel.Meter("github.com/getlantern/broflake/freddie") var err error nConcurrentGetReqs, err = m.Int64UpDownCounter("concurrent-get-reqs") if err != nil { diff --git a/go.mod b/go.mod index 105b6b04..199cc345 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/getlantern/unbounded +module github.com/getlantern/broflake go 1.19 diff --git a/netstate/d/netstated.go b/netstate/d/netstated.go index a616f02c..fda5c6c3 100644 --- a/netstate/d/netstated.go +++ b/netstate/d/netstated.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/getlantern/unbounded/common" - netstatecl "github.com/getlantern/unbounded/netstate/client" + "github.com/getlantern/broflake/common" + netstatecl "github.com/getlantern/broflake/netstate/client" ) type vertex string diff --git a/otel/otel_default_impl.go b/otel/otel_default_impl.go index 7c091bd2..be3feb47 100644 --- a/otel/otel_default_impl.go +++ b/otel/otel_default_impl.go @@ -11,8 +11,8 @@ import ( "go.opentelemetry.io/otel/trace" ) -func buTracer() trace.Tracer { - return otel.GetTracerProvider().Tracer("unbounded") +func broflakeTracer() trace.Tracer { + return otel.GetTracerProvider().Tracer("broflake") } // collectAndSendNATBehaviorTelemetry attempts to perform NAT behavior discovery, trying one batch @@ -46,6 +46,6 @@ func CollectAndSendNATBehaviorTelemetry(srvs []string, name string) { } } - _, span := buTracer().Start(context.Background(), name, attrs) + _, span := broflakeTracer().Start(context.Background(), name, attrs) span.End() } diff --git a/ui/public/widget.wasm b/ui/public/widget.wasm index ee43b7ae..6e4a239d 100755 Binary files a/ui/public/widget.wasm and b/ui/public/widget.wasm differ diff --git a/ui/src/utils/wasmInterface.ts b/ui/src/utils/wasmInterface.ts index 82b40307..49c0794a 100644 --- a/ui/src/utils/wasmInterface.ts +++ b/ui/src/utils/wasmInterface.ts @@ -72,7 +72,7 @@ export interface WasmClient extends EventTarget { // bind the client constructor declare global { - function newBU( + function newBroflake( type: string, cTableSz: number, pTableSz: number, @@ -150,7 +150,7 @@ export class WasmInterface { if (mock) { // fake it till you make it this.wasmClient = new MockWasmClient(this) } else { - this.wasmClient = globalThis.newBU( + this.wasmClient = globalThis.newBroflake( WASM_CLIENT_CONFIG.type, WASM_CLIENT_CONFIG.cTableSz, WASM_CLIENT_CONFIG.pTableSz,