Skip to content

How to read Automatic Proxy Detection (WPAD) in Asp.net core  #27323

Closed

Description

@Tratcher

From @xinlongli2018 on September 6, 2018 16:8

in asp.net we can use the following setting in web.config to point to a wpad.dat file to read all the proxy setting, is there a way we can achieve the same thing in asp.net core?

<system.net>
      <defaultProxy enabled="true" useDefaultCredentials="true">
        <proxy autoDetect="True" scriptLocation="http://wpad.dat" />
      </defaultProxy>
    </system.net>

Copied from original issue: dotnet/aspnetcore#3509

Activity

  1. davidsh commented on Sep 6, 2018

    @davidsh
    Contributor

    On Windows, the networking stack will read proxy configuration from the default IE settings. So, the equivalent would work the same:

    image

    However, the .NET Core networking stack doesn't use config files.

  2. xinlongli2018 commented on Sep 6, 2018

    @xinlongli2018

    Hi @davidsh, thank you for the reply, but do you know if this setting updates the registry value in windows? how do we achieve this during deployment? or if there is another solution like setting in the code level?

  3. davidsh commented on Sep 6, 2018

    @davidsh
    Contributor

    Hi @davidsh, thank you for the reply, but do you know if this setting updates the registry value in windows? how do we achieve this during deployment?

    In general, IE settings that are displayed in the UI dialog are translated to registry entries in the HKCU (per-user) registry area.

    There are several techniques to update those registry entries including using Group Policy. See examples: https://docs.microsoft.com/en-us/internet-explorer/ie11-deploy-guide/auto-configuration-settings-for-ie11

  4. xinlongli2018 commented on Sep 6, 2018

    @xinlongli2018

    @davidsh is there another way to point to the wpad file in the code level?

  5. davidsh commented on Sep 6, 2018

    @davidsh
    Contributor

    @davidsh is there another way to point to the wpad file in the code level?

    No. While you can use IWebProxy (HttpClientHandler.Proxy), that won't help with PAC file use (either automatic discovery or explicit). Only IE settings can be used to specify PAC file use.

  6. xinlongli2018 commented on Sep 6, 2018

    @xinlongli2018

    got it, thank you very much ! @davidsh

  7. davidsh commented on Sep 11, 2018

    @davidsh
    Contributor

    Closing as the question has been answered.

  8. transferred this issue fromdotnet/corefxon Jan 31, 2020
  9. added this to the 3.0 milestone on Jan 31, 2020
  10. ghost locked as resolved and limited conversation to collaborators on Dec 15, 2020
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

    area-System.NetquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions