Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket",
"version": "1.1.6",
"version": "1.1.7",
"description": "CLI for Socket.dev",
"homepage": "https://github.com/SocketDev/socket-cli",
"license": "MIT",
Expand Down
7 changes: 6 additions & 1 deletion src/utils/coana.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readJsonSync } from '@socketsecurity/registry/lib/fs'

import { getDefaultOrgSlug } from '../commands/ci/fetch-default-org-slug.mts'
import constants from '../constants.mts'
import { getDefaultApiToken } from './sdk.mts'
import { getDefaultApiToken, getDefaultProxyUrl } from './sdk.mts'
import shadowBin from '../shadow/npm/bin.mts'

import type { ShadowBinOptions } from '../shadow/npm/bin.mts'
Expand Down Expand Up @@ -52,6 +52,11 @@ export async function spawnCoana(
}
}

const proxyUrl = getDefaultProxyUrl()
if (proxyUrl) {
mixinsEnv['SOCKET_CLI_API_PROXY'] = proxyUrl
}

try {
const { spawnPromise } = await shadowBin(
'npx',
Expand Down
4 changes: 2 additions & 2 deletions src/utils/sdk.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getDefaultApiBaseUrl(): string | undefined {
}

// The Socket API server that should be used for operations.
function getDefaultProxyUrl(): string | undefined {
export function getDefaultProxyUrl(): string | undefined {
const apiProxy =
constants.ENV.SOCKET_CLI_API_PROXY || getConfigValueOrUndef('apiProxy')
return isUrl(apiProxy) ? apiProxy : undefined
Expand Down Expand Up @@ -114,7 +114,7 @@ export async function setupSdk(
}

const { apiBaseUrl = getDefaultApiBaseUrl() } = opts
const ProxyAgent = apiProxy?.startsWith('http:')
const ProxyAgent = apiBaseUrl?.startsWith('http:')
? HttpProxyAgent
: HttpsProxyAgent

Expand Down
Loading