An important step in embedding a Corda image is to tell Corda Embedder where Corda Server is located. This typically involves specifying the address using special Corda Embedder attributes (externalServerAddress and internalCommPortAddress).
To better understand the appropriate addresses for Corda Server, review the two types of addresses used with Corda Embedder.
Server Address
In order for Web clients to request images from Corda Server, they must contact the Corda Server over its server address. Web clients always access Corda Server over its server port which, by default, is 2001. This means that in typical development environments, where the Corda Server is running locally, the server address is http://localhost:2001 (or, in the case of some systems, http://127.0.0.1:2001).
This address, of course, is always going to depend on the way Corda Server has been configured. If Corda Server is running on a different machine, or if its port has been changed, the server address is different. When using the Corda Redirector, clustering, or the Corda Server Servlet, the server address also may be different.
The following table indicates what the server address may be under various circumstances. For situations where Corda Server is not running locally, replace server_address or ip_address with the external hostname or IP address of the server where Corda Server is actually running.
| Situation | Server Address |
|---|---|
| Normal | http:/server_address:2001 |
| Server port changed to 4001 | http://localhost:4001 |
| Server running on non-local machine | http://server_address:2001 |
| Server running on non-local machine (IP address) | http://ip_address:2001 |
| Corda Redirector | http://server_address/ctRedirector |
| Corda Redirector (Windows IIS) | http:/server_address/scripts/ctredirector.dll |
| Corda Server Servlet | http://server_address/corda |
Comm Port Address
The comm port address is the address that Corda Embedder uses to access the Corda Server. Corda Embedder always accesses the Corda Server over its comm port which, by default, is 2002.
The address part of the comm port (minus the port) address is often the same as the address for the server address—the only difference is the port uses 2002 instead of 2001. This means that in typical development environments, where the Corda Server is running locally, the comm port address is always http://localhost:2002 (or, in the case of some systems, http://127.0.0.1:2002).
This address, of course, is always going to depend on the way Corda Server has been configured. If Corda Server is running on a different machine, or if its comm port has been changed, the comm port address is different. When using clustering or the Corda Server Servlet, the comm port address also may be different.
The following table indicates what the server address may be under various circumstances. For situations where Corda Server is not running locally, replace server_address or ip_address with the external hostname or IP address of the server where Corda Server is actually running.
| Situation | Comm Port Address |
|---|---|
| Normal | http://localhost:2002 |
| Comm port changed to 4002 | http://localhost:4002 |
| Server running on non-local machine | http://server_address:2002 |
| Server running on non-local machine (IP address) | http://ip_address:2002 |
| Corda Redirector | http://server_address:2002 1 |
| Corda Server Servlet | http://server_address/corda |
1 Corda Embedder cannot talk to Corda Server through Corda Redirector. It must talk directly with Corda Server; therefore, redirection does not change the comm port address.