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

Add uploading via proxy #38

Open
cs-mshah opened this issue Aug 25, 2022 · 7 comments
Open

Add uploading via proxy #38

cs-mshah opened this issue Aug 25, 2022 · 7 comments

Comments

@cs-mshah
Copy link

I currently have to go through my college proxy to connect to the internet. This breaks the imgur upload as the proxy is not specified. Kindly make an option to specify proxy while uploading.
A better option would be to create an option to specify exact command line arguments too.

@gavvvr
Copy link
Owner

gavvvr commented Aug 25, 2022

Hi @cs-mshah. What type of proxy do you use in college? Http, socks or something else?

Also, what did you mean by cmd line args?

A better option would be to create an option to specify exact command line arguments too.

Obsidian is an electron-based app. Electron has cmd-line args for setting proxy globally for the whole app. Could you please try this and tell me if it will work out?
https://github.com/electron/electron/blob/v20.1.0/docs/api/command-line-switches.md#--proxy-serveraddressport

@cs-mshah
Copy link
Author

We use Http proxy. I tried to launch obsidian using obsidian --proxy-server=address:port but the image still wasn't uploaded.

@gavvvr
Copy link
Owner

gavvvr commented Aug 26, 2022

Ok. So, you can't upload without proxy.
I can add this feature.

What about displaying existing images? Do the get loaded with Obsidian in your college?

@cs-mshah
Copy link
Author

Yes, existing images are visible, which means that Obsidian does respect the proxy, but it seems that while uploading to imgur, proxy isn't used.

@gavvvr
Copy link
Owner

gavvvr commented Aug 27, 2022

I am surprised with such behavior. Are you sure they get loaded and not just cached from the times when you had a direct internet connection?
I am surprised, because I do not use anything special to upload images. It's just a regular fetch API provided by Chromium. If it respects proxy for loading images, why it does not respect it for uploading them? 🤔

@cs-mshah
Copy link
Author

So I got some surprising results:

  • Some of the old images were not visible. I tried again after connecting with proxy and they seem to appear good as before.
  • The upload also worked this time.

I feel that there is some issue of imgur with proxy, as I searched and found that several proxies block imgur. So if there are some domains that are free from the blocks then those could be used.
There doesn't seem to be an issue after all, but the results vary.

Can you support picgo core for upload? As I already have a tested configuration which works. All it requires is a command line argument and you can upload. It supports proxy too.

@gavvvr
Copy link
Owner

gavvvr commented Aug 29, 2022

I think the reason you've seen some images behind proxy is that they were cached. Some old images you did not open for a long time were unable to load.

I tried again after connecting with proxy and they seem to appear good as before.

How did you specify the proxy settings for Obsidian?

The upload also worked this time.

Good to hear 👏

I feel that there is some issue of imgur with proxy, as I searched and found that several proxies block imgur. So if there are some domains that are free from the blocks then those could be used.

I think good VPN should work well too

Can you support picgo core for upload?

Looks like there is already a fork which supports PicGo: https://github.com/renmu123/obsidian-image-auto-upload-plugin
If PicGo is a self-hosted solution, then what is the benefit of it comparing to default pasting images to the vault directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants