| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // We restrict wsprd to a special build-tag in order to enable |
| // security.OverrideCaveatValidation, which isn't generally available. |
| // Daemon wsprd implements the wspr web socket proxy as a stand-alone server. |
| // TODO(cnicolaou,benj): figure out how to support roaming as a chrome plugin |
| _ "v.io/x/ref/runtime/factories/roaming" |
| "v.io/x/ref/services/wspr/wsprlib" |
| wsprlib.OverrideCaveatValidation() |
| port := flag.Int("port", 8124, "Port to listen on.") |
| identd := flag.String("identd", "", "name of identd server.") |
| ctx, shutdown := v23.Init() |
| listenSpec := v23.GetListenSpec(ctx) |
| proxy := wsprlib.NewWSPR(ctx, *port, &listenSpec, *identd, nil) |
| nhost, nport, _ := net.SplitHostPort(addr.String()) |
| fmt.Printf("Listening on host: %s port: %s\n", nhost, nport) |
| <-signals.ShutdownOnSignals(ctx) |