Skip to content

Support proxy definition for fetch operation by using custom http client using proxy env var or flags to command line #5515

Open

Description

@matthewdwood82

Bug description

I am attempting to install a quarto extension for section bibliographies into a Quarto Book project using PowerShell.
https://github.com/pandoc-ext/section-bibliographies#quarto

When I attempt to do so, I receive this error
image

My project has my company's http_proxy and https_proxy defined in the .Rprofile

It is not clear from quarto help how the user would verify quarto can see these proxy settings.

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

Activity

  1. added
    bug
    on May 12, 2023
  2. cderv commented on May 12, 2023

    @cderv
    Member

    For reference this was also ask on Community: https://community.rstudio.com/t/chapter-references-in-quarto-pdf/166151

    I believe for quarto add (replacing quarto install) and using the Deno Fetch API, setting the env var should be supported : HTTP_PROXY, HTTPS_PROXY and NO_PROXY

    Is it not working ?

  3. matthewdwood82 commented on May 12, 2023

    @matthewdwood82
    Author

    It is not, using either quarto add pandoc-ext/section-bibliographies or the old quarto install extension pandoc-ext/section-bibliographies

    I'm new to Deno and TS, is there a good example of a setter using quarto run and a deno or ts script? The current quarto documentation provides a nice example of referencing a script file, but a layer of detail down on setting env vars would be helpful in my case.

    Thanks!

  4. cderv commented on May 12, 2023

    @cderv
    Member

    @dragonstyle the download method we use for quarto add seems to be the Fetch API from DENO. From doc, I was expecting the env var to be respected, but does not seems the case.

    Do you think it should work ?

    Otherwise, we may need to add some flags for proxy to set our call to download method with proxy values

  5. added
    triaged-to
    on May 12, 2023
  6. dragonstyle commented on May 12, 2023

    @dragonstyle
    Collaborator

    It looks to me like those env variables are respected by DENO for import resolution, but not natively by fetch (without a little code from us). Seem like we can create a custom http client for use in fetch:

    const client = Deno.createHttpClient({ proxy: { url: "http://myproxy.com:8080" } });
    const response = await fetch("https://myserver.com", { client });

    But we aren't using that in our core downloader :(. We probably need to support proxy flags for the commands + ideally we'd sniff those same env variables...

  7. matthewdwood82 commented on May 12, 2023

    @matthewdwood82
    Author

    Thanks @dragonstyle for the nice example. Will give it a try.

  8. matthewdwood82 commented on May 12, 2023

    @matthewdwood82
    Author

    It looks to me like those env variables are respected by DENO for import resolution, but not natively by fetch (without a little code from us). Seem like we can create a custom http client for use in fetch:

    const client = Deno.createHttpClient({ proxy: { url: "http://myproxy.com:8080" } });
    const response = await fetch("https://myserver.com", { client });

    But we aren't using that in our core downloader :(. We probably need to support proxy flags for the commands + ideally we'd sniff those same env variables...

    Sorry I didn't think to ask sooner, should https://myserver.com be a reference to my company's domain, or the GIT repo from which I'm trying to pull the extension?

  9. cderv commented on May 12, 2023

    @cderv
    Member

    @matthewdwood82 I am not sure if you want to test or just install the extension

    For the latter you can download the extension as an archive file, and install it from the local downloaded file
    https://quarto.org/docs/extensions/distributing.html#archive-files

    But we aren't using that in our core downloader :(. We probably need to support proxy flags for the commands + ideally we'd sniff those same env variables...

    @dragonstyle this is what I found also - I was not sure so thanks for confirming. It seems the view docs I found about env var with Fetch were wrong. Good to know !

    I'll rename the issue accordingly to what we need to do

  10. removed
    triaged-to
    on May 12, 2023
  11. changed the title [-]define proxies for quarto[/-] [+]Support proxy definition for fetch operation by using custom http client using proxy env var or flags to command line[/+] on May 12, 2023
  12. added this to the v1.4 milestone on May 12, 2023
  13. matthewdwood82 commented on May 12, 2023

    @matthewdwood82
    Author

    @matthewdwood82 I am not sure if you want to test or just install the extension

    For the latter you can download the extension as an archive file, and install it from the local downloaded file https://quarto.org/docs/extensions/distributing.html#archive-files

    But we aren't using that in our core downloader :(. We probably need to support proxy flags for the commands + ideally we'd sniff those same env variables...

    @dragonstyle this is what I found also - I was not sure so thanks for confirming. It seems the view docs I found about env var with Fetch were wrong. Good to know !

    I'll rename the issue accordingly to what we need to do

    Thanks @cderv , more interested in installing extension, using an archive sounds like a fine way to stay out of server and client config shenanigans.

    Reporting back shortly...

  14. matthewdwood82 commented on May 12, 2023

    @matthewdwood82
    Author

    That worked! We can close this one, pending any future enhancement the dev team here decides to make wrt quarto and proxies.

    Thanks @cderv & @dragonstyle for your help!

  15. 3 remaining items

  16. added
    enhancement
    on May 15, 2023
  17. matthewdwood82 commented on May 16, 2023

    @matthewdwood82
    Author

    🎉

  18. modified the milestones: v1.4, v1.5 on Nov 29, 2023
  19. added
    extensions
    on Feb 7, 2024
  20. modified the milestones: v1.5, Future on Feb 7, 2024
  21. IliasAarab commented on Feb 19, 2025

    @IliasAarab

    Any updates available? Would be nice to be able to set proxies.

  22. JackGraymer commented on Apr 3, 2025

    @JackGraymer

    Same, would be nice to use some proxies like with pip: pip install setuptools --proxy=http://111.222.33.4:8844
    While trying to install an extension through a zip file I get an error as if Quarto still needs a connection to the original repo:
    ERROR: TypeError: A network error occurred when attempting to inspect the extension '/TinyTeX'. Please try again.
    Both the zip file and the uncompressed folder are in my local folder.
    For the zip quarto add TinyTeX.zip I get:

        Found 0 extensions.
    ERROR: Invalid extension
    The extension staged at C:\Users\[user]\AppData\Local\Temp\quarto-session94ebbca66661e0a7\b6c7e0aaa74825bc\e7a22611fafb2cdc\staged does not provide any valid extensions.
    

    When trying the unzipped folder with: quarto add /TinyTeX

    ERROR: TypeError: A network error occurred when attempting to inspect the extension '/TinyTeX'. Please try again.
    
  23. mcanouil commented on Jan 12, 2026

    @mcanouil
    Collaborator

    Quarto Wizard (https://m.canouil.dev/quarto-wizard/) the VSCode/Positron extension now supports classical environment variables for proxy.

    This should help getting access to Quarto extensions from being proxy/firewall while the Quarto CLI issue is being fixed in the future.

    Note

    This is a third party tool.
    It might be seen as a workaround rather than a fix.

  24. matthewdwood82 commented on Jan 14, 2026

    @matthewdwood82
    Author

    This is fantastic, look forward to trying!

  25. reopened this on Jan 14, 2026
  26. cderv commented on Jan 14, 2026

    @cderv
    Member

    I reopen as Quarto Wizard is an external tool that helps, but ultimately we may want to fix in quarto CLI itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementextensions

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions