0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Mac]テザリングでもSockプロキシの設定がしたい

Last updated at Posted at 2017-10-26

SSHの設定で DynamicForward することでVPNもどきをしてます。
VPNもどきをするときは、Macのネットワーク設定でロケーションを作って以下のようにSOCKS Proxy設定をしてます。

Screen Shot 2017-10-26 at 12.23.24.png

wifiに繋いでいるときはうまく動作していたのですが、iPhoneのUSBテザリングだと動いてくれませんでした。

んで、調べたらすぐヒットしました。↓
https://gist.github.com/mapk0y/9437aadbd7629acbe26a

この記事をみる限り、ターミナルから設定すればイケるとのこと。

ってなわけで、やってみました。

まず、proxy.pacを作ります。
自分の場合は、作成したロケーション選択時は全てプロキシを介すという設定で良いので、以下のような内容になります。

function FindProxyForURL(url, host) { 
    // 設定画面の [SOCKS Proxy Server]欄の内容                                                                                                                                                                        
    return "SOCKS localhost:8888";
}

proxy.pacを作成したら、以下のコマンドを実行。

networksetup -setautoproxyurl "ロケーション名" file://[proxy.pacの絶対パス] on

これで、ちゃんと動きました。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?