iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 22
0
自我挑戰組

全端工程師的日常挑戰三十日系列 第 22

fiddler 設定需驗證代理伺服器(proxy with authentication)

fiddler 設定需驗證代理伺服器(proxy with authentication)

不管是第三方介接或是 mobile device 開發,不免都會使用到外部 API,除了使用 postman 進行 API 內容確認外,fiddler 更是開發階段的一大利器

1. 開啟設定頁面

Tools --> Telerik Fiddler Options...

step1

2.代理伺服器(proxy)相關設定

Gatway --> Manual Proxy Configuration: 

2-1. 設定代理伺服器(proxy)

http=proxyserver:proxyport;https=proxyserver:proxyport;

2proxysetting

2-2. 指定排除的 ip(不使用proxy)

  • 可以使用 domain 或 ip

    1fiddlerbypass

3. 直接在 request 內容中加入認證(crednetial)

  • Rules --> Customize Rules...

    step3

  • 在 OnBeforeRequest 加入 oSession.oRequest["Proxy-Authorization"] = "Basic QURcdXNlcm5hbWU6cGFzc3dvcmQ=";

4. 如何取得 crednetial 內容

Tools --> TextWizard 

STEP4

4-1. 加密

  • 貼上欲加密內容-->TransfromTo Base64 --> click Send output to input
  • AD\username:password-->QURcdXNlcm5hbWU6cGFzc3dvcmQ=

4-2. 解密

  • 貼上欲解密內容-->TransfromFrom Base64 --> click Send output to input
  • QURcdXNlcm5hbWU6cGFzc3dvcmQ=-->AD\username:password

    decrypt

參考資料

stackoverflow


上一篇
Vue.js 2.0 基礎 API 與 Directives 用法範例
下一篇
Decimal in C# 的隱含轉換建構式
系列文
全端工程師的日常挑戰三十日31
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言