Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

オブジェクトストレージとの通信にProxyを使うかを選択できるように #6245

Conversation

rinsuki
Copy link
Contributor

@rinsuki rinsuki commented Apr 11, 2020

Summary

Fix #6243

image

@mei23
Copy link
Contributor

mei23 commented Apr 11, 2020

TODO: ローカルのキャッシュが悪いのかlocalesに追加してるのに反映されない

バージョン変えてビルドして5秒あけて2回リロードすればいけるはず

@rinsuki
Copy link
Contributor Author

rinsuki commented Apr 11, 2020

された thanks

@rinsuki rinsuki requested review from syuilo and mei23 April 11, 2020 17:25
@@ -11,7 +11,7 @@ export function getS3(meta: Meta) {
sslEnabled: meta.objectStorageUseSSL,
s3ForcePathStyle: !!meta.objectStorageEndpoint,
httpOptions: {
agent: meta.objectStorageUseSSL ? httpsAgent : httpAgent
agent: meta.objectStorageUseProxy ? (meta.objectStorageUseProxy ? httpsAgent : httpAgent) : undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSL で Prxoyを使う場合 HttpsProxyAgent
SSL で Prxoyを使う場合 https.Agent
非SSL で Prxoyを使う場合 HttpProxyAgent
非SSL で Prxoyを使う場合 http.Agent
なのでこれだとちょっと挙動が違う
結局下のところを分解しないといけない
https://github.com/syuilo/misskey/blob/c62aff76af427eb5f7cff0ddc835996754785f44/src/misc/fetch.ts#L30-L42

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

別にproxy入る前はundefined相当だったしundefined返せばよいのではという気持ち

https://github.com/syuilo/misskey/blob/bb7edfee04d990fcf56e0cee46f1da7b62693cb6/src/services/drive/s3.ts

Copy link
Contributor

@mei23 mei23 Apr 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefinedだと (httpsでも) keep-aliveなどが効かなくなるのでパフォーマンスが悪くなります

proxyとkeep-aliveは同時に入れていってます

  • httpsのproxyとkeep-alive対応 を追加
  • httpもproxyとkeep-alive対応 を追加

(httpに) proxy入る前は (httpは) undefined相当 だったけど
(https) は proxyとkeep-alive が入った状態です

@mei23
Copy link
Contributor

mei23 commented Apr 12, 2020

いちおう、これの変更は https://github.com/syuilo/misskey/pull/6244 にマージして修正しています

@syuilo
Copy link
Member

syuilo commented Apr 12, 2020

#6244をマージしたのでこちらは閉じます。
ありがとうございます🥰

@syuilo syuilo closed this Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants