MCPcopy Create free account
hub / github.com/github/copilot-sdk / Configure

Method Configure

go/internal/e2e/testharness/proxy.go:141–162  ·  view source on GitHub ↗

Configure sends configuration to the proxy.

(filePath, workDir string)

Source from the content-addressed store, hash-verified

139
140// Configure sends configuration to the proxy.
141func (p *CapiProxy) Configure(filePath, workDir string) error {
142 p.mu.Lock()
143 url := p.proxyURL
144 p.mu.Unlock()
145
146 if url == "" {
147 return fmt.Errorf("proxy not started")
148 }
149
150 config := fmt.Sprintf(`{"filePath":%q,"workDir":%q}`, filePath, workDir)
151 resp, err := http.Post(url+"/config", "application/json", strings.NewReader(config))
152 if err != nil {
153 return fmt.Errorf("failed to configure proxy: %w", err)
154 }
155 defer resp.Body.Close()
156
157 if resp.StatusCode != 200 {
158 return fmt.Errorf("proxy config failed with status %d", resp.StatusCode)
159 }
160
161 return nil
162}
163
164// GetExchanges retrieves the captured HTTP exchanges from the proxy.
165func (p *CapiProxy) GetExchanges() ([]ParsedHttpExchange, error) {

Callers 2

TestPermissionsE2EFunction · 0.45
ConfigureForTestMethod · 0.45

Calls 1

CloseMethod · 0.65

Tested by 1

TestPermissionsE2EFunction · 0.36