GithubHelp home page GithubHelp logo

Comments (11)

timhall avatar timhall commented on August 28, 2024

@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.

Kyle123 avatar Kyle123 commented on August 28, 2024

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.

timhall avatar timhall commented on August 28, 2024

WinHTTP looks interesting, seems like the more modern solution. I'll try it out right now and see how it works.

from vba-web.

ststreck avatar ststreck commented on August 28, 2024

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.

timhall avatar timhall commented on August 28, 2024

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.

timhall avatar timhall commented on August 28, 2024

@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.

timhall avatar timhall commented on August 28, 2024

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 replace Http.setProxy 0 with Http.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.

timhall avatar timhall commented on August 28, 2024

(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.

paolodemo avatar paolodemo commented on August 28, 2024

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:

  1. Into HttpSetup function the PrepareProxyForHttpRequest must be moved after the HttpOpen
  2. 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.

paolodemo avatar paolodemo commented on August 28, 2024

Update:
Setting LoginByDefault = True in the authenticator does the flow works.

from vba-web.

timhall avatar timhall commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.