Proxy settings npm escape '\' char

I am behind a corporate proxy and I need to set the settings on npm. The only problem is my username contains \char. The proxy server setup should look like this: http://PREFIX\username:password@proxy.company.com:portbut the end result is as follows: http://prefix/username:password@proxy.company.com:portwhich is completely wrong.

The room %5Cinstead \does not work. Also do not enter your username and password, or the entire URL in "".

I know this question has been asked many times, but none of the solutions have done this for me. I'm on a typewriter for windows. I would appreciate it if you have any suggestions.

+4
source share
2 answers

You must percent-encode | encode special characters. For example. instead of this:

http://foo:B/r@domain.com:8080

you write this:

http://foo:B%2Fr@domain.com:8080

So, /replaced by %2F.

+2
source

Use% 5C, it will replace '\'

http://foo:T\abc@test.com:8080

to

http://foo:T%5Cabc@test.com:8080
0
source

Source: https://habr.com/ru/post/1623742/


All Articles