The ccproxy
utility is the proxy that allows you to develop and debug your code. The script allows you to route your storefront requests through a local node.js
application, which intercepts certain resources and then substitutes them with a local modified version. When the server starts up, it looks at your widget, element, stack and theme metadata and then builds mappings of the server data to local files to the local files downloaded by the dcu
utility.
Note: Before you can use ccproxy
, you must redirect your browser HTTP traffic to the port on which ccproxy
is listening. Refer to your browser documentation for information on browser-specific proxy switchers.
Work with HTTPS traffic
When using a proxy to connect to a secure HTTPS site, you must generate a self-signed certificate for the storefront or preview node . Once you have created the certificate, import it into the browser as a trusted CA. The proxy then accepts the browser’s traffic request and responds with its own certificate.
The following is an example how to create a key and a certificate for ccproxy
:
$ cd <cloud-files>/.ccc ccc $ openssl genrsa -out ./ccproxy-root-ca.key.pem 2048 ccc $ openssl req -x509 -new -nodes -key ccproxy-root-ca.key.pem -days 1024 \ -out ./ccproxy-private-root-ca.crt.pem \ -subj "/C=US/O=ACME Certificates/CN=<commerce cloud node>"
In the above example, the ccproxy
utility looks for the ccproxy-root-ca
and the ccproxy-private-root-ca
on startup to set up its fake certificate authority. You would then import ccproxy-private-root-ca.crt.pem
into your browser as a trusted CA.
Note: The browser proxy switcher that you use must also be set up to redirect HTTP and HTTPS traffic to the ccproxy
host.
The following table describes the options you can use with the ccproxy
utility.
Option | Description |
---|---|
| Provides usage information for the utility. |
| Provides the utility’s version number. |
| The URL for the administration interface on the target Commerce Cloud instance, for example, |
| Changes the port on which the |
| Uses the directory indicated as the base directory. |