プロキシ設定(Node.js)
最終更新日: 2024年7月22日
- トピック:
- APIs/SDKs
作成対象:
- 開発者
Node SDK の HTTP リクエストのプロキシを設定するには、初期化中に SDK が使用するフェッチ API を上書きします。
次に、TargetClient
の初期化中に fetchApi
を上書きしてプロキシを追加する方法を示す基本的な例を示します。
const { ProxyAgent } = require("undici");
const proxyAgent = new ProxyAgent("your proxy address here");
const fetchImpl = (url, options) => {
const fetchOptions = options;
fetchOptions.dispatcher = proxyAgent;
return fetch(url, fetchOptions);
};
client = TargetClient.create({
...,
fetchApi: fetchImpl
});
これは、ノードのデフォルト fetch
であるノードバージョン 18.2 以降 undici.fetch
のみ機能することに注意してください。
Node SDK サンプルリポジトリを参照してください。
(古いバージョンのノードのプロキシ設定の例やその他詳細情報)。
Target
- Adobe Target開発者ガイド
- 入門
- クライアントサイド実装
- 概要:Target をクライアント側 web に実装する
- Adobe Experience Platform Web SDK 実装の概要
- at.js の実装
- at.js の概要
- at.js の仕組み
- at.js のデプロイ方法
- オンデバイス判定
- at.js 関数
- at.js 関数の概要
- adobe.target.getOffer()
- adobe.target.getOffers() - at.js 2.x
- adobe.target.applyOffer()
- adobe.target.applyOffers() - at.js 2.x
- adobe.target.triggerView() - at.js 2.x
- adobe.target.trackEvent()
- mboxCreate() - at.js 1.x
- targetGlobalSettings()
- mboxDefine() と mboxUpdate() - at.js 1.x
- targetPageParams()
- targetPageParamsAll()
- registerExtension() - at.js 1.x
- sendNotifications() - at.js 2.1
- at.js カスタムイベント
- Adobe Experience Cloud デバッガーを使用した at.js のデバッグ
- Target でのクラウドベースのインスタンスの使用
- at.js の FAQ
- at.js のバージョンの詳細
- at.js 1.x から at.js 2.x へのアップグレード
- at.js の cookie
- User-agent と client hints
- グローバル mbox について
- サーバーサイド実装
- ハイブリッド実装
- Recommendations実装
- モバイルアプリの実装
- メール実装
- の API ガイド
- 実装パターン