| // proxyd is a daemon that listens for connections from veyron services |
| // (typically behind NATs) and proxies these services to the outside world. |
| "veyron/runtimes/google/ipc/stream/proxy" |
| "veyron/runtimes/google/lib/publisher" |
| // TODO(rthellend): Remove the address and protocol flags when the config manager is working. |
| address = flag.String("address", ":0", "Network address the proxy listens on") |
| pubAddress = flag.String("published_address", "", "Network address the proxy publishes. If empty, the value of --address will be used") |
| protocol = flag.String("protocol", "tcp", "Network type the proxy listens on") |
| httpAddr = flag.String("http", ":14142", "Network address on which the HTTP debug server runs") |
| name = flag.String("name", "", "Name to mount the proxy as") |
| rid, err := naming.NewRoutingID() |
| proxy, err := proxy.New(rid, nil, *protocol, *address, *pubAddress) |
| publisher := publisher.New(r.NewContext(), r.Namespace(), time.Minute) |
| defer publisher.WaitForStop() |
| publisher.AddServer(naming.JoinAddressName(proxy.Endpoint().String(), "")) |
| if err = http.ListenAndServe(*httpAddr, nil); err != nil { |