wakatime / vscode-wakatime

Visual Studio Code plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/vs-code
BSD 3-Clause "New" or "Revised" License
1.2k stars 133 forks source link

Not able to use proxy format https://:@host:port #357

Closed carloswm85 closed 10 months ago

carloswm85 commented 1 year ago

I'm behind a proxy, using the following valid address for VSCode:

image

But Wakatime requires that I use:

image

I tried to use the same setting I have in internet options, but that didn't work either.

image

What can I do?

Tai-Zhou commented 11 months ago
public static validateProxy(proxy: string): string {
    if (!proxy) return '';
    let re;
    if (proxy.indexOf('\\') === -1) {
      re = new RegExp('^((https?|socks5)://)?([^:@]+(:([^:@])+)?@)?[\\w\\.-]+(:\\d+)?$', 'i');
    } else {
      re = new RegExp('^.*\\\\.+$', 'i');
    }
    if (!re.test(proxy))
      return 'Invalid proxy. Valid formats are https://user:pass@host:port or socks5://user:pass@host:port or domain\\user:pass';
    return '';
  }

According to the code, you can use http://10.1.33.254:80 or https://10.1.33.254:80 (or even 10.1.33.254:80), depends on your server.

carloswm85 commented 10 months ago

It seems to be that changing https into http worked in my proxyed computer.

But now, I'm getting this message in two of my computers:

image

I've generated a new API key, and pasted it into VSCode. Do you know what may be the problem?

Also, do you know any good alternative to WakaTime? I'd like to get a full history of my activities, but I'm not currently able to pay their service (also, I'm wondering if the history generated in this application is somewhat portable into other apps).

Tai-Zhou commented 10 months ago

But now, I'm getting this message in two of my computers:

I've generated a new API key, and pasted it into VSCode. Do you know what may be the problem?

Maybe you should turn on the Command Palette (Ctrl+Shift+P) and input wakatime api key and paste the key again.

Also, do you know any good alternative to WakaTime? I'd like to get a full history of my activities, but I'm not currently able to pay their service (also, I'm wondering if the history generated in this application is somewhat portable into other apps).

Sorry I have no idea for that.

alanhamlett commented 10 months ago

@carloswm85 I looked into your account it it shows as receiving data from you VS Code now, so you got it working?

Closing this issue as fixed.

carloswm85 commented 10 months ago

@carloswm85 I looked into your account it it shows as receiving data from you VS Code now, so you got it working?

Closing this issue as fixed.

How many computers can you see? If there's 2 of them, it seems to be fixed.

alanhamlett commented 10 months ago

How many computers can you see? If there's 2 of them, it seems to be fixed.

I see two, which you can check here: https://wakatime.com/api/v1/users/current/machine_names

Also, I recommend typing in vscode on the computer that wasn't working, then check this page: https://wakatime.com/plugins/status Within a few minutes, that page should update showing your VS Code as last seen recently.