hasura / hasura/graphql-engine

Should separate --address flag from `hasura console` into --address and --bind-address

Open
#7,241 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

When I'm running hasura console, I'm only given a chance to configure --address once. I assume this is because hasura-cli is assumed to be running on localhost. However, address does two things:
1. Binds both the api server and the console server to be running on that hostname (using http.ListenAndServe, which ultimately uses net.Listen)
2. Points the served console page towards the served api server.

According to the net.Listen documentation: https://pkg.go.dev/net#Listen
```
The address can use a host name, but this is not recommended, because it will create a listener for at most one of the host's IP addresses.
```

My setup requires me to run hasura console on a remote dev machine, and my local needs to connect to that dev machine. However, when I run hasura console:
- if i add `--address 0.0.0.0`, then the served console page will attempt to access the api server via `http://0.0.0.0:9693`, which cannot be reached.
- if i add `--address myhostname`, then the net.Listen will bind to 127.0.0.1, which doesn't allow me to access it from my computer.

It would be ideal if I could get hasura console to bind to 0.0.0.0, while using myhostname to locate the migrate api server.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.