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

-h, --help

Provides usage information for the utility.

-V, --version

Provides the utility’s version number.

-n, --node <node>

The URL for the administration interface on the target Commerce Cloud instance, for example, http://localhost:9080. Used with --grab, --put, and --putAll. If --node is not specified, the utility attempts to use the most recently specified node.

-P, --port <number>

Changes the port on which the ccproxy listens. The default is 8088. Alternatively, you can set the CC_DEVPROXY_PORT environment variable.

-b, --base <directory>

Uses the directory indicated as the base directory.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices