Skip to content
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

Implement proxy settings for TestCafe #1206

Closed
georgiy-abbasov opened this issue Feb 2, 2017 · 20 comments
Closed

Implement proxy settings for TestCafe #1206

georgiy-abbasov opened this issue Feb 2, 2017 · 20 comments
Assignees
Labels
AREA: client AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API SYSTEM: hammerhead SYSTEM: runner TYPE: enhancement The accepted proposal for future implementation.
Milestone

Comments

@georgiy-abbasov
Copy link
Contributor

Are you requesting a feature or reporting a bug?

feature

What is the current behavior?

In corporate networks, where browser have specified proxy settings for access to WEB, TestCafe cannot establish connection to the remote resources, cause all requests are sent directly to the remote host, bypassing corporate proxy.

What is the expected behavior?

TestCafe should provide capability to setup proxy options, like http proxy url, http proxy port etc

@churkin
Copy link
Contributor

churkin commented Feb 3, 2017

@AlexanderMoskovkin
Copy link
Contributor

Let determine API for this feature.
My proposal:
CLI:

New options:
--proxy-url
--proxy-ignore

testcafe chrome tests/ --proxy-url x.x.x.x --proxy-ignore "a.com,b.com"

Programming Interface:

const proxyUrl = 'x.x.x.x'
const ignoreHosts = ['a.com', 'b.com'];

runner
    .proxy(proxyUrl, ignoreHosts)

/cc @DevExpress/testcafe-docs @inikulin @VasilyStrelyaev

@inikulin
Copy link
Contributor

What's proxy ignore options are for?

@VasilyStrelyaev
Copy link
Collaborator

maybe proxy-bypass instead of proxy-ignore (if I get it right)?

@AlexanderMoskovkin
Copy link
Contributor

So, as I understand, we've decided don't add proxy-ignore option for now.

CLI:

New option:
--proxy-url

testcafe chrome tests/ --proxy-url x.x.x.x

Programming Interface:

const proxyUrl = 'x.x.x.x'

runner
    .proxy(proxyUrl)

Is it ok?

@georgiy-abbasov
Copy link
Contributor Author

@AlexanderMoskovkin, we can specify proxy port in the url, if it necessary. I mean, change 'x.x.x.x' to 'x.x.x.x:yyyy' in these snippets (in the docs in the future).

@AlexanderMoskovkin AlexanderMoskovkin self-assigned this Mar 6, 2017
AlexanderMoskovkin added a commit to AlexanderMoskovkin/testcafe that referenced this issue Mar 9, 2017
@tiagorosendo
Copy link

any update ?

@inikulin
Copy link
Contributor

inikulin commented Apr 4, 2017

@tiagorosendo We are working on it. More likely it will be released in alpha in a couple of weeks.

@tiagorosendo
Copy link

Ok thanks !

@anescobar1991
Copy link

Why did you guys decide on not adding proxy-ignore option? Is there any plan to add this in future and if not can I help contribute?

@inikulin
Copy link
Contributor

inikulin commented May 4, 2017

@anescobar1991 We've decided to start with minimal feature set and add advanced features afterwards if there will be a demand for them. If you are interested in this feature, open new issue, please. PRs are welcome as well.

@wengxuan
Copy link

any update on this?

@AlexanderMoskovkin
Copy link
Contributor

It's already available (since the 0.15.0 version). See the --proxy option for details.

@n0v1
Copy link

n0v1 commented Dec 22, 2017

It seems that the proxy option sets the proxy even for requests to localhost, I think it would make sense to ignore the proxy for requests to localhost or 127.0.0.1. What do you think?

@AlexanderMoskovkin
Copy link
Contributor

@n0v1, It sounds reasonable. We'll think about it in the context of the #1791 issue.

@MishraApa
Copy link

MishraApa commented Mar 22, 2018

@AlexanderEgorov

I tried below your solutions to implement Proxy setting but did not get any proper solution:

1)I tried with command (testcafe chrome tests/ --proxy-url x.x.x.x --proxy-ignore "a.com,b.com") but it does not work for me . Can you please provide the exact syntax.

2)test runner -It's saying proxy is not a function

Also i gone thorugh http://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/browsers/user-profiles.html and tried with new user profile but it also does work for me .

It would be great if you can reply ASAP.

@AlexanderMoskovkin
Copy link
Contributor

Hi @MishraApa,

You can find the correct TestCafe API in our documentation.
Now TestCafe has option --proxy which specifies the proxy server in your local network to access the Internet.
The proxy-ignore feature is not implemented yet but will be included in the next TestCafe release.

@MishraApa
Copy link

Hi @AlexanderMoskovkin

I have tried above solution provided in documentation to host proxy but none of the solution is working for me .Could please suggest how to do proxy setting testcafe ?

Thanks
Aparna

@AlexanderMoskovkin
Copy link
Contributor

AlexanderMoskovkin commented Mar 22, 2018

Could you please describe your issue in details? What url you'd like to open in your tests, what the proxy do you use, what happens when you run your tests?

@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…ress#1431)

* Proxy settings have been implemented (closes DevExpress#1206)

* some remarks

* requested changes

* hostname -> host

* externalProxyUrl -> externalProxyHost
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API SYSTEM: hammerhead SYSTEM: runner TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

10 participants