HearthSim / Hearthstone-Deck-Tracker

A deck tracker and deck manager for Hearthstone on Windows
https://hsreplay.net/downloads/
4.73k stars 1.12k forks source link

add Proxy support #3825

Open Moschkara opened 5 years ago

Moschkara commented 5 years ago

Please add proxy support to application to be able fetch decks from the web and updates while behind the web proxy.

It would be nice feature for all who are in work ;) behind www proxy. Thank you for your work and great app!

riQQ commented 5 years ago

Can you try adding the following section to the AppConfig file %LOCALAPPDATA%\HearthstoneDeckTracker\app-<replace-with-version-number>\HearthstoneDeckTracker.exe.config. This requirest that the proxy is set in the Windows / Internet Explorer options:

<system.net>
    <defaultProxy />
</system.net>  

Full file example:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <runtime>
      <loadFromRemoteSources enabled="true" />
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="MahApps.Metro" publicKeyToken="f4fb5a3c4d1e5b4f" culture="neutral" />
                <bindingRedirect oldVersion="1.1.2.0" newVersion="1.5.0.23" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.net>
        <defaultProxy />
    </system.net>  
</configuration>
Moschkara commented 5 years ago

I am using webproxy from FireFox. I will try your suggestion.

If I try the code below, will it work out for me?: `

`
riQQ commented 5 years ago

So the proxy isn't configured in the windows options? I don't know, you'll have to try.

Moschkara commented 5 years ago

So the proxy isn't configured in the windows options?

no.

`

</system.net> ` This works, but is inconvenient.

I look forward to when include this feature in the program.

In the meantime, I will experiment with the proxy settings

riQQ commented 5 years ago

How is it inconvenient for you?

Moschkara commented 5 years ago

constantly change the proxy server, disable it and enable it if necessary.

Recently, it stopped working again.

I look forward to the support in HDT

sorry for bad english

riQQ commented 5 years ago

I don't really understand your use case. Why do you have to constantly change the proxy server? What did stop working?

oweaF commented 4 years ago

https://docs.microsoft.com/en-us/dotnet/framework/network-programming/proxy-configuration#static-proxies

<system.net>
    <defaultProxy>
        <proxy
            proxyaddress="http://127.0.0.1:7890"
            usesystemdefault="false"
            bypassonlocal="true"
        />
    </defaultProxy>
</system.net> 

It might work if you want to use a dedicated proxy server. update: Tested, it work.