Skip to content

Commit a1e83f5

Browse files
committed
Revert "feature added: socks proxy"
1 parent 123dc84 commit a1e83f5

File tree

6 files changed

+3
-20
lines changed

6 files changed

+3
-20
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ if You input wrong word, the workflow will correct your input, and You can press
4040
| domain | https://translate.google.com | if you cannot access the default domain, you can config this. <br />大陆访问不了默认域名,所以如果使用2.x版本需要将这个变量设置为https://translate.google.cn. 或者还是使用[1.x版本](https://github.com/xfslove/alfred-google-translate/tree/v1.x) |
4141
| read | remote | avaliable values: <br />remote: fetch voice from google, <br />local: use macOS local voice (notice: maybe only works on English),<br />none: dont get voice |
4242
| save_count | 20 | limit count of translate history, see [alfred-translate-history](https://github.com/xfslove/alfred-translate-history). <br />0 means dont save translate history |
43-
| socks_proxy | undefined | not turned by default. if you still cannot access after you config domain as https://translate.google.cn, you can specify local or remote socks proxy. format: `socks://{host}:{port}` example: local shadowsocks proxy 'socks://127.0.0.1:1086' |
4443

4544
##### environment variables config snapshot:
4645

agent.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"alfy": "^0.6.0",
4141
"configstore": "^2.0.0",
4242
"got": "^6.3.0",
43-
"socks-proxy-agent": "^4.0.2",
4443
"uuid": "^3.3.2"
4544
},
4645
"devDependencies": {

token.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
var got = require('got');
99
var Configstore = require('configstore');
10-
var agent = require('./agent')
1110

1211
/* eslint-disable */
1312
// BEGIN
@@ -81,7 +80,7 @@ function updateTKK(domain) {
8180
if (Number(window.TKK.split('.')[0]) === now) {
8281
resolve();
8382
} else {
84-
got(domain, {agent: agent}).then(function (res) {
83+
got(domain).then(function (res) {
8584
var matches = res.body.match(/tkk:\s?'(.+?)'/i);
8685

8786
if (matches) {

translate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var got = require('got');
44

55
var token = require('./token');
66
var languages = require('./languages');
7-
var agent = require('./agent');
87

98
function translate(text, opts) {
109
opts = opts || {};
@@ -28,7 +27,7 @@ function translate(text, opts) {
2827
data[token.name] = token.value;
2928
return url + '?' + querystring.stringify(data);
3029
}).then(function (url) {
31-
return got(url, {agent: agent}).then(function (res) {
30+
return got(url).then(function (res) {
3231
var result = {
3332
text: '',
3433
from: {

tts.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ var got = require('got');
33

44
var token = require('./token');
55
var languages = require('./languages');
6-
var agent = require('./agent')
76

87
function tts(text, opts) {
98
opts = opts || {};
@@ -22,7 +21,7 @@ function tts(text, opts) {
2221
data[token.name] = token.value;
2322
return url + '?' + querystring.stringify(data);
2423
}).then(function (url) {
25-
return got(url, {encoding: null, agent: agent}).then(function (res) {
24+
return got(url, {encoding: null}).then(function (res) {
2625

2726
return res.body;
2827

0 commit comments

Comments
 (0)