Skip to content

Unable to start dev server with domain configured by PAC (proxy auto-config) #3789

Closed
@levrik

Description

@levrik

I'm using a PAC (proxy auto-config) file to redirect all domains ending with .local to a local development proxy without messing around with my hosts file.
This seems to don't play well when using the HOST environment variable in cra.

image

Settings DANGEROUSLY_DISABLE_HOST_CHECK to true has no effect.

Environment

  1. node -v: v8.9.0
  2. npm -v: 4.0.5
  3. yarn --version (if you use Yarn): 1.3.2
  4. npm ls react-scripts (if you haven’t ejected): 1.0.17

Then, specify:

  1. Operating system: Windows 10

Steps to Reproduce

  1. Configure a URL to an PAC file with the following content:
function FindProxyForURL (url, host) {
  if (dnsDomainIs(host, '.local')) {
    return 'PROXY 127.0.0.1:2000';
  }

  return 'DIRECT';
}
  1. Setup an reverse proxy (nginx, whatever) to listen on port 2000 with a .local domain configured with the cra dev server as target.
  2. Configure HOST to your .local domain.
  3. Try to start cra. It gets stuck for some time before showing the above error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions