Skip to content

增强proxy: 对齐webpack devServer的proxy #2868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zuoxue0119 opened this issue Nov 1, 2018 · 0 comments
Open

增强proxy: 对齐webpack devServer的proxy #2868

zuoxue0119 opened this issue Nov 1, 2018 · 0 comments

Comments

@zuoxue0119
Copy link

Version

3.1.1

Node and OS info

Node 10.13.0

Steps to reproduce

proxy: [
      {
        context: '/ajax',
        target: 'https://localhost:3000',
      },
      {
        context: function (pathname, req) {
          const env = getPathnameEnv(pathname);
          return env === 'online';
        },
        target: 'https://localhost:8081',
        changeOrigin: true,
      },
]

What is expected?

增强proxy, 对齐 webpack devServer的proxy
支持proxy数组与 http-proxy-middleware中所有格式的context, 例如

proxy: [
      {
        context: '/ajax',
        target: 'https://localhost:3000',
      },
      {
        context: function (pathname, req) {
          const env = getPathnameEnv(pathname);
          return env === 'online';
        },
        target: 'https://localhost:8081',
        changeOrigin: true,
      },
]

What is actually happening?

目前不支持数组类型的proxy, 也不支持自定义函数的context

zuoxue0119 added a commit to zuoxue0119/vue-cli that referenced this issue Nov 1, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant