Skip to content

Commit

Permalink
Mocking host
Browse files Browse the repository at this point in the history
  • Loading branch information
joelgriffith committed Aug 23, 2018
1 parent aa73447 commit 54b160a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
chromedriver_version=2.39
1 change: 0 additions & 1 deletion Dockerfile
Expand Up @@ -6,7 +6,6 @@ ENV HOST=0.0.0.0
ENV PORT=3000
ENV application_directory=/usr/src/app
ENV font_directory=/usr/share/fonts/noto
ENV CHROMEDRIVER_VERSION=2.39

# Build Args
ARG USE_CHROME_STABLE
Expand Down
3 changes: 2 additions & 1 deletion src/webdriver-provider.ts
Expand Up @@ -45,7 +45,7 @@ export class WebDriver {
getPort().then(async (port) => {
const chromeProcess = chromeDriver.start([
'--url-base=wd/hub',
'--whitelisted-ips',
'--whitelisted-ips=127.0.0.1',
`--port=${port}`,
'--verbose',
]);
Expand Down Expand Up @@ -85,6 +85,7 @@ export class WebDriver {
await sleep(25);

proxy.web(req, res, (error) => {
req.headers.host = '127.0.0.1:3000';
debug(`Issue in webdriver: ${error.message}`);
res.end();
done();
Expand Down

0 comments on commit 54b160a

Please sign in to comment.