Skip to content

Commit

Permalink
docs: comment localhost:<port> vs :<port> for server "listen" specifi…
Browse files Browse the repository at this point in the history
…cations (kythe#3906)
  • Loading branch information
kamahen authored and schroederc committed Aug 7, 2019
1 parent d8df920 commit c41cf52
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.langserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ bazel-bin/kythe/go/indexer/cmd/go_indexer/go_indexer -code $(find bazel-out/k8-f
# See https://github.com/kythe/kythe/issues/3412.
bazel-bin/kythe/go/serving/tools/write_tables/write_tables --entries $ENTRIES --experimental_beam_pipeline --out $TAB
# Serve.
bazel-bin/kythe/go/serving/tools/http_server/http_server --serving_table $TAB --listen 0.0.0.0:8080 --public_resources $UI
# Serve. ("--listen :8080" allows access from other machines)
bazel-bin/kythe/go/serving/tools/http_server/http_server --serving_table $TAB --listen localhost:8080 --public_resources $UI
```

## Augment the local-to-vname mapping
Expand Down
2 changes: 1 addition & 1 deletion kythe/docs/schema/writing-an-indexer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ mkdir -p graphstore tables
# Host the browser UI.
/opt/kythe/tools/http_server -serving_table tables \
-public_resources="/opt/kythe/web/ui" \
-listen="localhost:${BROWSE_PORT}"
-listen="localhost:${BROWSE_PORT}" # ":${BROWSE_PORT}" allows access from other machines
----

TIP: The
Expand Down
6 changes: 4 additions & 2 deletions kythe/examples/bazel/kythe-index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Paths to output artifacts are controlled with the --graphstore and --serving_tab
defaults are $TMPDIR/gs.bazel and $TMPDIR/serving.bazel, respectively.
The --serving_addr flag controls the listening address of the Kythe http_server.
It's default is localhost:8888. Any --webui path provided will be passed to the
Its default is localhost:8080. ("localhost:8080" allows access from
only the same machine the server is running on; ":8080" allows access
from any machine.) Any --webui path provided will be passed to the
http_server as its --public_resources flag.
The --bazel_root and --kythe_repo flags control which Bazel repository to index
Expand All @@ -56,7 +58,7 @@ BAZEL_ROOT="$PWD"

GRAPHSTORE="$TMPDIR"/gs.bazel
SERVING_TABLE="$TMPDIR"/serving.bazel
SERVING_ADDR=localhost:8888
SERVING_ADDR=localhost:8080 # :8080 allows access from any machine
WEBUI=()

EXTRACT=
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/languageserver/bin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
pageSize = flag.Int("page_size", 0, "Set the default xrefs page size")

serverAddr = flag.String("server", "localhost:8080",
"The address of the Kythe service to use")
"The address of the Kythe service to use (:8080 allows access from other machines)")
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/tools/http_server/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (
var (
servingTable = flag.String("serving_table", "", "LevelDB serving table")

httpListeningAddr = flag.String("listen", "localhost:8080", "Listening address for HTTP server")
httpListeningAddr = flag.String("listen", "localhost:8080", "Listening address for HTTP server (\":<port>\" allows access from any machine)")
httpAllowOrigin = flag.String("http_allow_origin", "", "If set, each HTTP response will contain a Access-Control-Allow-Origin header with the given value")
publicResources = flag.String("public_resources", "", "Path to directory of static resources to serve")

Expand Down
2 changes: 1 addition & 1 deletion kythe/release/appengine/xrefs/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
var (
servingTable = flag.String("serving_table", "/srv/table", "LevelDB serving table path")
publicResources = flag.String("public_resources", "/srv/public", "Path to directory of static resources to serve")
listeningAddr = flag.String("listen", "localhost:8080", "Listening address for HTTP server")
listeningAddr = flag.String("listen", "localhost:8080", "Listening address for HTTP server (:<port> allows access from any machine)")
)

func main() {
Expand Down
5 changes: 3 additions & 2 deletions kythe/rust/cargo-kythe/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ fn web(kythe_dir: &Path) {
"-public_resources",
&kythe_dir.join("web/ui").to_string_lossy(),
"-grpc_listen",
"localhost:8081",
"localhost:8081", // ":8081" allows access from any machine
"-listen",
"localhost:8080"])
"locahost:8080" // ":8080" allows access from any machine
])
.spawn()
.expect("could not start http_server");

Expand Down
2 changes: 2 additions & 0 deletions kythe/web/site/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ basic cross-reference capabilities. The following command can be run over the
serving table created with the `write_tables` binary (see above).

{% highlight bash %}
# --listen localhost:8080 allows access from only this machine; change to
# --listen :8080 to allow access from any machine
/opt/kythe/tools/http_server \
--public_resources /opt/kythe/web/ui \
--listen localhost:8080 \
Expand Down

0 comments on commit c41cf52

Please sign in to comment.