Skip to content

how can I intercept the SK outbound https traffic for debugging and troubleshooting? such as using mitmweb/mitmproxy #1513

Closed Answered by craigomatic
AwesomeYuer asked this question in Q&A
Discussion options

You must be logged in to vote

Perhaps the Environment.SetEnvironmentVariable calls are not propagating?

Another approach you could try:

//give the HttpClient an instance of your proxy via the HttpClientHandler
var httpClient = new HttpClient(new HttpClientHandler { Proxy = new MyProxy() });

var sk = Kernel.Builder.WithAzureChatCompletionService(
"<deployment name>", 
"<endpoint>", 
"<key>", 
true, 
null, 
false, 
httpClient); //the HttpClient you pass in here is used by the underlying completion methods

//change the GetProxy URI below if it differs from what you need
class MyProxy : IWebProxy
{
    public ICredentials? Credentials { get; set; }

    public Uri? GetProxy(Uri destination)
    {
        return new Uri("h…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AwesomeYuer
Comment options

Answer selected by AwesomeYuer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants