@eeacms/volto-corsproxy

中文文档
5.0.1发布于 2026/04/09MITCommonJS零依赖近 30 天下载 2894

volto-corsproxy: Volto add-on

原始使用文档
文档目录8 节
  1. Features
  2. Getting started
  3. Try volto-corsproxy with Docker
  4. Add volto-corsproxy to your Volto project
  5. Release
  6. How to contribute
  7. Copyright and license
  8. Funding

volto-corsproxy

Releases

Pipeline Lines of Code Coverage Bugs Duplicated Lines (%)

Pipeline Lines of Code Coverage Bugs Duplicated Lines (%)

Volto add-on

Features

This package enables fetching data from third-party servers through the Volto HTTP server, this way bypassing any CORS security restrictions imposed by the browser.

The way it does this is by providing a pass-through CORS proxy server on the path (configurable) /cors-proxy path. For example, any requests made to the URL http://localhost:3000/cors-proxy/http://example.com/ will be piped to the http://example.com website, through the Volto node server.

As you wouldn't want to provide an open proxy, all proxied destinations need to be configured either via settings.allowed_cors_destinations (which takes a list of hostnames) or an environment variable called RAZZLE_ALLOWED_CORS_DESTINATIONS (where you need to provide a comma-separated list of hostnames).

For example:

settings.allowed_cors_destinations = ['eea.europa.eu', 'plone.org']

or:

RAZZLE_ALLOWED_CORS_DESTINATIONS=eea.europa.eu,plone.org yarn start

As a convenience feature for dealing with third-party API endpoints, there's a new action available, getProxiedExternalContent, somewhat similar to Volto's getContent. Call it like: getProxiedExternalContent(thirdpartyurl) and it will make that async content available in the Redux content reducer, at store.content.subrequests[thirdpartyurl].

Getting started

Try volto-corsproxy with Docker

  git clone https://github.com/eea/volto-corsproxy.git
  cd volto-corsproxy
  make
  make start

Go to http://localhost:3000

make start now defaults to Volto 18. To run the same setup against Volto 17, use:

  VOLTO_VERSION=17 make
  VOLTO_VERSION=17 make start

Add volto-corsproxy to your Volto project

  1. Make sure you have a Plone backend up-and-running at http://localhost:8080/Plone

    docker compose up backend
    
  2. Start Volto frontend

  • If you already have a volto project, just update package.json:

    "dependencies": {
        "@eeacms/volto-corsproxy": "*"
    }
    

and volto.config.js:

const addons = ['@eeacms/volto-corsproxy'];
  • If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:

    uvx cookieplone project
    cd project-title
    
  1. Install or update dependencies, then start the project:

    make install
    

    For a Cookieplone project, start the backend and frontend in separate terminals:

    make backend-start
    make frontend-start
    

    For a legacy Volto 17 project, install the package with yarn and restart the frontend as usual.

  2. Go to http://localhost:3000

  3. Happy editing!

Release

See RELEASE.md.

How to contribute

See DEVELOP.md.

The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.

See LICENSE.md for details.

Funding

European Environment Agency (EU)

版本与发布记录

@eeacms/volto-corsproxy 共发布 21 个版本,首次发布于 2020/11/13;过去 12 个月发布了 2 个版本。

版本发布日期距今
5.0.1latest2026/04/097 个月前
5.0.02026/03/257 个月前
4.0.02024/04/232 年前
3.1.52023/10/313 年前
3.1.42023/09/303 年前
3.1.32023/07/243 年前

关于 @eeacms/volto-corsproxy 的常见问题

@eeacms/volto-corsproxy 是什么?

volto-corsproxy: Volto add-on

如何安装 @eeacms/volto-corsproxy?

在项目目录运行 npm install @eeacms/volto-corsproxy,或使用 pnpm add / yarn add / bun add。

@eeacms/volto-corsproxy 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/eeacms__volto-corsproxy 是否存在。

@eeacms/volto-corsproxy 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@eeacms/volto-corsproxy 可以商用吗?

@eeacms/volto-corsproxy 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@eeacms/volto-corsproxy 的下载量有多少?

根据 npm 官方下载统计,@eeacms/volto-corsproxy 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,894 次,日均约 96 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@eeacms/volto-corsproxy 还在维护吗?

最新版本 5.0.1 发布于 2026/04/09(7 个月前);至今共发布 21 个版本,其中过去 12 个月发布了 2 个;首次发布于 2020/11/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。