Comments (11)
@ststreck It appears ServerXMLHTTP (which Excel-REST uses) does not auto-discover proxy settings. I'll switch back to the traditional XMLHTTP seems better suited for spreadsheet applications anyways.
from vba-web.
I think that WinHTTP may be a better choice than XMLHTTP, it also offers the benefit of handling the cookies when required
from vba-web.
WinHTTP looks interesting, seems like the more modern solution. I'll try it out right now and see how it works.
from vba-web.
What I liked with the ServerXMLHTTP is the possibility to work with Cookie Headers.
An working Cookie Management and Proxy support would be the 100% solution.
from vba-web.
Quick update: I'm running into some issues with Requests being released from memory before handling async responses, but I have some ideas on possible solutions so it's looking like switching over to WinHTTPRequest
should work.
Another very nice side effect of switching to WinHTTPRequest
is that sync requests don't lock up Excel as badly thanks to WaitForResponse
. You still can't do anything while the request is executing, but I haven't seen any "Stopped Responding" notices during execution like I used to see before during long running requests and it isn't as CPU intensive as a DoEvents loop was when I tried that before.
from vba-web.
@ststreck I've pushed a patch that uses the setProxy
method with ServerXMLHTTP
to use the default proxy settings for the computer. Do you mind testing this for your case? (I don't have access to a computer with a proxy setup) You should only need to update the RestClient
class from the proxy-functionality branch:
https://raw.github.com/timhall/Excel-REST/proxy-functionality/src/RestClient.cls
While switching to the more modern WinHTTPRequest
would have been nice (and still may be possible) I ran into too many memory issues with objects being released while waiting for the request to callback. Hopefully ServerXMLHTTP
will be a good compromise with cookies included and (hopefully) proxy functionality sorted out.
from vba-web.
I got an email response from @ststreck
The new Proxy line does not work, but I have no Idea why it does not get the right settings.
When I use Fiddler all Traffic is routed thru "localhost"
When I replaceHttp.setProxy 0
withHttp.setProxy 2, "127.0.0.1:8888"
then it is working.But I know this is only a local solution for me.
I'll look back into switching to WinHTTPRequest
to hopefully resolve this issue.
from vba-web.
(Sorry for the delay) Based on the amount of code that would need to switched to use WinHTTPRequest
, I've pushed default proxy functionality to v3.0 of Excel-REST sometime in the future. In the meantime, I've added a RestClient.SetProxy
method that allows you to set a proxy without having to dig into the Excel-REST source. Not the most ideal solution, but I think it's the best approach for now.
Example:
' RestClient.SetProxy(ProxyServer As String, _
' Optional Username As String, _
' Optional Password As String, _
' Optional BypassList As Variant)
Dim Client As New RestClient
Client.BaseUrl = "https://api.website.com"
Client.SetProxy "127.0.0.1:8888"
' Client.Execute ...
from vba-web.
I'm working into a network with proxy configuration trying to access the google services.
I tested v3.1.4 and I see 2 problems:
- Into HttpSetup function the PrepareProxyForHttpRequest must be moved after the HttpOpen
- The GoogleAuthenticator doesn't use the proxy so its request provide 408 (timout) error
Fixing both this I again have:
ERROR - GoogleAuthenticator.Token: Failed to load token: 400 - {
"error" : "invalid_request",
"error_description" : "Missing required parameter: code"
}
I'm checking if this last error is related to the proxy or not.
from vba-web.
Update:
Setting LoginByDefault = True
in the authenticator does the flow works.
from vba-web.
Hi @paolodemo thanks for bringing this up. I'll look into the GoogleAuthenticator and ordering and see if I can patch it and will definitely make sure it's fixed in v4
from vba-web.
Related Issues (20)
- Can't install this tool HOT 2
- Excel 2016 For Mac 64-Bit Update - 'Internal Errors'
- Run time error 10001: error parsing json expecting "" or ''' HOT 13
- Installation no longer works since the office update HOT 2
- Not sure how to proceed with HttpBasicAuthenticator HOT 1
- Get Json from Google-Drive work on Windows but not on Mac HOT 1
- Update GitHub language breakdown HOT 1
- AWS Authentication
- Uploading a PDF to SharePoint REST API using an ADODB stream HOT 1
- Authenticator for Zoho Creator API
- Calling POST API Content-Type-application/json and getting error "Cannot deserialize the current JSON object" HOT 2
- 保存 HOT 1
- POST API to Verint, the connection is not getting authorised HOT 1
- Excel VBA
- Error with OAuth1.0 Authentication HOT 1
- あ
- Saving Image Response To A PNG File In Mac
- Better version that reads the object properties and makes into a table with headers: HOT 1
- AddQuerystringParam with cyrillic value characters HOT 7
- (Google Authenticator) Access blocked: request is invalid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vba-web.