WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
180408
WebDriver: implement proxy support
https://bugs.webkit.org/show_bug.cgi?id=180408
Summary
WebDriver: implement proxy support
Carlos Garcia Campos
Reported
2017-12-05 02:54:29 PST
https://w3c.github.io/webdriver/webdriver-spec.html#proxy
Attachments
Patch
(25.22 KB, patch)
2019-11-08 01:06 PST
,
Carlos Garcia Campos
no flags
Details
Formatted Diff
Diff
Patch
(27.51 KB, patch)
2019-11-11 02:36 PST
,
Carlos Garcia Campos
clopez
: review+
clopez
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Blaze Burg
Comment 1
2018-01-30 09:14:17 PST
safaridriver work tracked by <
rdar://problem/36854985
>. For safaridriver, we'd need WKWebView support for proxy settings that hook into the NSURLSession. I suppose other network stacks have similar settings to propagate.
Carlos Garcia Campos
Comment 2
2019-11-08 01:06:37 PST
Created
attachment 383117
[details]
Patch
EWS Watchlist
Comment 3
2019-11-08 01:07:36 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See
http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Carlos Alberto Lopez Perez
Comment 4
2019-11-08 05:06:28 PST
Comment on
attachment 383117
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=383117&action=review
> Source/WebDriver/WebDriverService.cpp:367 > + if (proxy.type == "pac") { > + String autoconfigURL; > + if (!proxyObject.getString("proxyAutoconfigUrl"_s, autoconfigURL)) > + return WTF::nullopt; > + > + proxy.autoconfigURL = autoconfigURL; > + return proxy; > + }
This type of proxy doesn't seem to be handled. Maybe returning an error is more according to the spec than silently accepting it and ignoring it?
> Source/WebDriver/WebDriverService.cpp:415 > + if (proxyObject.getValue("socksProxy", value)) { > + String socksProxy; > + if (!value->asString(socksProxy)) > + return WTF::nullopt; > + > + proxy.socksURL = URL({ }, makeString("socks://", socksProxy)); > + if (!proxy.socksURL->isValid()) > + return WTF::nullopt; > + > + RefPtr<JSON::Value> socksVersionValue; > + if (!proxyObject.getValue("socksVersion", socksVersionValue)) > + return WTF::nullopt; > + > + auto socksVersion = unsignedValue(*socksVersionValue); > + if (!socksVersion || socksVersion.value() > 255) > + return WTF::nullopt; > + proxy.socksVersion = socksVersion.value(); > + }
socksVersionValue seems to be ignored when constructing socksURL. It is true that webkit_network_proxy_settings_add_proxy_for_scheme() works with the three types of sock proxies if not a specific version is specified, but I think its better to be specific here is the user/application has requested a specific type of proxy. This is my suggestion: * proxy.socksURL should start with: - if socksVersionValue is invalid/missing or anything other than 4 or 5 -> socks:// - if socksVersionValue is 4 and socksURL is an IP Adresss -> socks4:// - if socksVersionValue is 4 and socksURL is a domain name -> socks4a:// - if socksVersionValue is 5 -> socks5://
Carlos Garcia Campos
Comment 5
2019-11-08 06:06:04 PST
Comment on
attachment 383117
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=383117&action=review
>> Source/WebDriver/WebDriverService.cpp:367 >> + } > > This type of proxy doesn't seem to be handled. > Maybe returning an error is more according to the spec than silently accepting it and ignoring it?
Yes, I thought about it, I'll add a way to ask platform is a particular proxy types is supported.
>> Source/WebDriver/WebDriverService.cpp:415 >> + } > > socksVersionValue seems to be ignored when constructing socksURL. > It is true that webkit_network_proxy_settings_add_proxy_for_scheme() works with the three types of sock proxies if not a specific version is specified, but I think its better to be specific here is the user/application has requested a specific type of proxy. > > This is my suggestion: > * proxy.socksURL should start with: > - if socksVersionValue is invalid/missing or anything other than 4 or 5 -> socks:// > - if socksVersionValue is 4 and socksURL is an IP Adresss -> socks4:// > - if socksVersionValue is 4 and socksURL is a domain name -> socks4a:// > - if socksVersionValue is 5 -> socks5://
I had no idea how to specify the socks version, I'll do what you suggest here.
Carlos Garcia Campos
Comment 6
2019-11-11 02:36:59 PST
Created
attachment 383257
[details]
Patch
Carlos Alberto Lopez Perez
Comment 7
2019-11-11 05:28:12 PST
Comment on
attachment 383257
[details]
Patch r=me. Thanks! But before landing check build on wincairo EWS: It broke because platformSupportProxyType() is not defined there.
Carlos Garcia Campos
Comment 8
2019-11-11 07:13:56 PST
I forgot there's wincairo implementation of WebDriver
Carlos Garcia Campos
Comment 9
2019-11-11 07:16:23 PST
Committed
r252323
: <
https://trac.webkit.org/changeset/252323
>
Radar WebKit Bug Importer
Comment 10
2019-11-11 16:57:47 PST
<
rdar://problem/57099330
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug