Use ports to route to canisters when using dfx start
#2651
Replies: 6 comments 1 reply
-
You can already use |
Beta Was this translation helpful? Give feedback.
-
How do I use it where's it at? |
Beta Was this translation helpful? Give feedback.
-
Hi @ninegua , thanks for the info! I didn't know. Unfortunately this still requires knowing the canister ID, which is created dynamically, am I correct? Also can you clarify what you mean by "the frontend canister"? Does that only work if you have exactly one canister of type |
Beta Was this translation helpful? Give feedback.
-
@ninegua Thanks! I didn't know either. I was wondering why we weren't using subdomains of localhost. I know they are unsupported on old linux but I tested some recent-ish machines and subdomains resolved correctly on all of them. Didn't get as far as testing Mac. |
Beta Was this translation helpful? Give feedback.
-
I think we can consider this handled. Please reopen if not. |
Beta Was this translation helpful? Give feedback.
-
@sesi200 unfortunately not, there is still no good story for connecting to other canisters (locally) without relying on the canister ID generation sequence, or looking up non-public Even @ninegua's suggestion (which only works in some browsers like
|
Beta Was this translation helpful? Give feedback.
-
Currently, running
dfx start
will start a replica-ish executable that will proxy HTTP requests to installed canisters based on the value of?canisterId=...
. This is not ideal for the following reasons:/
when the user logs out, which will break because of the missing?canisterId=...
.In the nns-dapp we are working around this by using a proxy that maps (stable, known) ports to canister -- by name. In particular, our end-to-end test runner will start by looking up the canister IDs in
.dfx/local/canister_ids.json
and the replica host indfx.json
and will then route requests appropriately. The test suite can then uselocalhost:<stable port>
to reach a given canister. It would be great to have something similar baked intodfx
as opposed to using query parameters.Beta Was this translation helpful? Give feedback.
All reactions