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

[help wanted] How can I make vs-picgo work behind the proxy? #79

Closed
Rullec opened this issue Jan 13, 2021 · 10 comments
Closed

[help wanted] How can I make vs-picgo work behind the proxy? #79

Rullec opened this issue Jan 13, 2021 · 10 comments
Labels
bug Something isn't working question Further information is requested

Comments

@Rullec
Copy link

Rullec commented Jan 13, 2021

Hi guys,

Thanks a lot for your work on this awesome plugin, I really benifit a lot from it ;-)

I work with vscode (vs-picgo 2.1.0 has been installed, and the image bed is github) on Ubuntu 18.04 LTS. How can I enable the proxy for the uploading procedure in it? Does it follow the system proxy settings? Is there anything I can do to customize it?

Thanks a lot!

@Rullec Rullec changed the title [help wanted] How can I make vs-picgo behind the proxy? [help wanted] How can I make vs-picgo work behind the proxy? Jan 13, 2021
@upupming
Copy link
Member

upupming commented Jan 13, 2021

@Rullec Thanks for the feedback. You can just add this configuration to your VSCode Settings as per the docs:

"picgo.picBed.proxy": "127.0.0.1:1081"

Although this config is not listed on the settings page and you will get a warning like a picture below, but it is totally fine as vs-picgo will read all configurations under the picgo.picBed and pass it to picgo-core:

image

We will add this configuration to the settings page in the next release~


The code above is wrong, it should be http://127.0.0.1:1081.

@Rullec
Copy link
Author

Rullec commented Jan 13, 2021

We will add this configuration to the settings page in the next release~

@upupming Thanks for your quick response and guidance!

Now I can upload my images happily, even potentially without the proxy setting.

Though It doesn't effect the functionality, I still post it here just in case.


  • Just now, I tried to paste an image from clipboard to vscode by the shortcut ctrl + alt + U without the proxy setting, and It WORKS WELL.

  • Then as you said, I added picgo.picBed.proxy in my global settings.json manually (I confirm my http proxy work behind the local port 12333). as shown below:

    "picgo.picBed.current": "github",
    "picgo.picBed.github.branch": "main",
    "picgo.picBed.github.path": "vscode/",
    "picgo.picBed.github.repo": "XXXXXXXXXXXX",
    "picgo.picBed.github.token": "XXXXXXXXXXXXXXXXXXXXXXXXX",
    "picgo.customUploadName": "${dateTime}${extName}",
    
    "picgo.picBed.proxy" : "127.0.0.1:12333",
  • kill and reopen the vscode.
  • Then I do the copy-paste work again in vscode, and monitoring the proxy log in another window. It seems the picgo doesn't use the proxy...
    image

@upupming
Copy link
Member

upupming commented Jan 13, 2021

@Rullec Nice caught up!

Sorry for the wrong configuration, instead of 127.0.0.1:1081, you should use http://127.0.0.1:1081 like below:

"picgo.picBed.proxy": "http://127.0.0.1:1081",

Here is my test result:

image

And the proxy is corrected passed to picgo-core (I add a console.warn to see what config is passed in):

image


The reason why the wrong configuration can still work may due to GitHub is sometimes fast and sometimes slow in the EDU network. You can change the configuration to the corrected version and try to see your proxy tool's log again. If you have any problems, please fell free to post here again.

@Rullec
Copy link
Author

Rullec commented Jan 13, 2021

@upupming Thank you very much for the patience! I'm sorry to reply this closed issue again, cuz there is still a tiny problem for me to ask ;-)

due to GitHub is sometimes fast and sometimes slow in the EDU network.

Yes! It must be the duty of ZJUWLAN ;-), you know....

you should use http://127.0.0.1:1081

I will add the prefix http:// in front of my localhost in the settings.json tomorrow morning, in order to have a quick test.


A problem / question for curiosity

I'm really curious about the screenshot you posted above, it's:
image

Because of the lackness of knowledge of the frontend, I felt hard to recognize where I can get this console. Would you be happy to give me some insight?

Thanks a lot!

@upupming
Copy link
Member

@Rullec

I felt hard to recognize where I can get this console. Would you be happy to give me some insight?

This is just my test to confirm that proxy will work although it is not listed on the settings page. If you want to have a test, too, here are the steps:

  1. Open file ~/.vscode/extensions/spades.vs-picgo-2.1.0/out/src/vs-picgo/index.js, this is the place where the plugin is installed to.
  2. Goto line 47 or search for const picBed = vscode.workspace.getConfiguration('picgo.picBed');
  3. Add console.warn('picBed', picBed)
    image
  4. Kill and restart VSCode and test uploading again, and with developer tools (Help -> Toggle Developer Tools) open to see the log.

@Rullec
Copy link
Author

Rullec commented Jan 14, 2021

Thanks!

@upupming upupming added the question Further information is requested label Jan 14, 2021
@upupming upupming reopened this Jan 14, 2021
@upupming
Copy link
Member

PicGo/PicGo-Core#64

@upupming upupming added the bug Something isn't working label Jan 14, 2021
@Molunerfinn
Copy link
Member

try picgo-core 1.4.16

@upupming
Copy link
Member

upupming commented Feb 8, 2021

try picgo-core 1.4.16

Nice, thanks!

@upupming
Copy link
Member

Close as no response, please feel free to open a new issue if still has trouble.

Spades-S added a commit that referenced this issue Jul 26, 2021
* 📦 Chore: add bump version (#32)

* 📦 Chore: add picgo bump version

* 📦 Chore: substitute npm with yarn

* 📦 Chore: move pre-commit to husky for using by `git cz`

* 📦 Chore: finish azure pipeline & remove appveyor

* 🔙 Revert: fix mistake in test script

* 📝 Docs: make readme tidier

* 📝 Docs: revert to details/summary tags

* 📝 Docs: update license

* 📝 Docs: add upupming to license

* 📝 Docs: currect azure project name (#33)

* ⬆️ Upgrade: picgo to 1.3.6

fix bugs when upload images from clipboard in Windows 7

ISSUES CLOSED: #34

* 🎉 Release: 2.0.4

* 🐛 Fix: add tencent cos path option

* 🔨 Refactor: code structure, message consistency, fix settings changing issue, out-of-box format(#36)

* 🔨 Refactor: code structure

* 🐛 Fix: picgo -> vspicgo, prettier fix

* 🐛 Fix: on load -> before upload plugin

* 🎨 Style: log -> data

* 🐛 Fix: get config, editor each time

* 🎨 Style: message consistency

* 🐛 Fix: qiniu.area enum -> string

* 🐛 Fix: update picgo on settings changed

* ✨ Feature: out-of-box format

* 🔙 Revert: still using enum for qiniu area

* 🔨 Refactor: singleton pattern for `picgo`

* 🐛 Fix: add tencent cos path option

* 🔨 Refactor: replace require with fs

* 📝 Docs: readme.md

add summary tag in details tag aimed at PicGo-electorn users

* 📝 Docs: fix custom upload name & custom output format docs

* 📝 Docs: update issue templates

* 📝 Docs: code format

* ✅ Test: add basic testes (#42)

* ✅ Test: add basic testes

* 🐛 Fix: import -> require

* 🐛 Fix: build

* 📦 Chore: add coveralls env

* ✨ Feature: test report on command line

* Update package.json

* 🐛 Fix: coverage

* ✨ Feature: report to coveralls

* 🐛 Fix: use sed to fix lcov.info's relative path

* ⬆️ Upgrade: fix querystringify vulnerability

* 🐛 Fix: azure pipeline + coveralls

see
https://github.com/dylan-smith/node-coveralls/blob/10e327653aa0f2f382efee3af800beae0aabaac5/lib/getOptions.js

* 📦 Chore: azure -> github actions

* ✨ Feature(package.json): support sm.ms V2

upgrade dependencies, support sm.ms V2

ISSUES CLOSED: #57

* 📦 Chore: replace tslint with eslint

* 📦 Chore(.vscode): update .vscode

* 🎨 Style: run codestyle:fix

* 📝 Docs: update docs: README.md, CHANGELOG.md

* 📝 Docs: update README.md

* ✅ Test(test): refactor unit tests

* 📦 Chore: add coverage collector

* build(deps): bump lodash from 4.17.15 to 4.17.19 (#68)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump decompress from 4.2.0 to 4.2.1 (#71)

Bumps [decompress](https://github.com/kevva/decompress) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/kevva/decompress/releases)
- [Commits](kevva/decompress@v4.2.0...v4.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump ini from 1.3.5 to 1.3.7 (#73)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: 🎸 add support for svg (#74)

add support for svg image while choosing files

* 🐛 Fix(ci): github actions use yarn to lock versions (#77)

* 🐛 Fix(clipboard): set `PICGO_ENV` to `CLI`, fixes #75 (#78)

* 🐛 Fix(clipboard): set `PICGO_ENV` to `CLI`, fixes #75

also update picgo core
add failed message

* 🐛 Fix(version): 2.0.4 -> 2.1.0

* 📦 Chore(deps): update deps

* 📦 Chore(bundle): add webpack

* 🐛 Fix(proxy): add proxy config, fixes #79

* ⬆️ Upgrade: update picgo core

* 📦 Chore: migrate to standardjs (#83)

* 🚧 WIP(code style): migrate to standardjs

* 🐛 Fix(upload): upload events off

* ✅ Test: fix test configuration

* 📦 Chore: add console for message

* 🐛 Fix: show message should not block following operations

* ⬆️ Upgrade(core): upgrade dependencies (#92)

Co-authored-by: Yiming Li <yimingli.cs@gmail.com>

* 🎉 Release: v2.1.1

* 🐛 Fix(dep): bundle picgo-core to dist

* 🎉 Release: v2.1.2

Co-authored-by: Li Yiming <upupming@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kkyeer <kkyeer@gmail.com>
Co-authored-by: Yiming Li <yimingli.cs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants