share my solution for who work inside and wanna live outside the GFW.
Env: MacOS with shadowsocks-ng
~/.bash_profile
alias cbrew="ALL_PROXY=socks5://127.0.0.1:1086 brew"
# using polipo
alias cfirebase="http_proxy=http://127.0.0.1:8123 firebase"
# your shadowsocks may already have http proxy feature
alias cfirebase="http_proxy=http://127.0.0.1:1087 firebase"
up polipo http proxy (optional)
cbrew install polipo
polipo socksParentProxy=localhost:1086 &
login
cfirebase login --debug
polyfill faye-websocket
Thanks @namiwang it works.
because firebase sdk 2.x.x is minified, so... polyfill faye-websocket is easier than fix sdk.
// if you installed node by brew, the path would be /usr/local/lib/node_modules/firebase-tools/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/client.js
...
var proxy_uri = process.env.http_proxy
if (proxy_uri) {
options.proxy = { origin: proxy_uri }
}
...
deploy
cfirebase deploy --only functions --debug
Actually, newer firebase sdk already fixed the bug. Waiting firebase-tools up deps to date...
网友评论