-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
145 lines (117 loc) · 3.2 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# r.proxy
<!-- badges: start -->
<!-- badges: end -->
The goal of r.proxy is to Set Proxy in R Console.
This project is inspired by [zsh-proxy](https://github.com/SukkaW/zsh-proxy).
## Installation
You can install the development version of r.proxy like so:
``` r
# install.packages("devtools")
devtools::install_github("xiayh17/r.proxy")
```
## Example
This is a basic example which shows you how to use it:
Start proxy by `proxy()`
Configrations interactive will show only in the first time you use.
```{r start_first, eval=FALSE}
r.proxy::proxy()
```
``` r
#> This maybe the first time proxy4you be load.
#> Please complete below configrations:)
#> Default setting can be accessed by Enter with nothing
#> [socks5 proxy] {Default as 127.0.0.1:7890} (address:port): 192.168.3.15:7890
#> [https proxy] {Default as 127.0.0.1:7890} (address:port):
#> [http proxy] {Default as 127.0.0.1:7890} (address:port):
#> Your setting have been save in ~/.Rproxy
#> Proxy info:
#> http://127.0.0.1:7890http://192.168.3.15:7890socks5://127.0.0.1:7890
#> check what your ip is:
#> IPv4:
#> 91.243.81.71
#>
#> Details:
#> {
#> "organization": "MoreneHost",
#> "longitude": 6.1661,
#> "timezone": "Europe/Luxembourg",
#> "isp": "MoreneHost",
#> "offset": 3600,
#> "asn": 199524,
#> "asn_organization": "G-Core Labs S.A.",
#> "country": "Luxembourg",
#> "ip": "91.243.81.71",
#> "latitude": 49.7498,
#> "continent_code": "EU",
#> "country_code": "LU"
#> }
```
```{r start_after, eval=FALSE}
r.proxy::proxy()
```
``` r
#> Proxy info:
#> http://127.0.0.1:7890http://192.168.3.15:7890socks5://127.0.0.1:7890
#> check what your ip is:
#> IPv4:
#> 91.243.81.71
#>
#> Details:
#> {
#> "organization": "MoreneHost",
#> "longitude": 6.1661,
#> "timezone": "Europe/Luxembourg",
#> "isp": "MoreneHost",
#> "offset": 3600,
#> "asn": 199524,
#> "asn_organization": "G-Core Labs S.A.",
#> "country": "Luxembourg",
#> "ip": "91.243.81.71",
#> "latitude": 49.7498,
#> "continent_code": "EU",
#> "country_code": "LU"
#> }
```
Stop proxy by `noproxy()`
```{r stop}
r.proxy::noproxy()
```
Reset proxy by `init_proxy()`
```{r reset, eval=FALSE}
r.proxy::init_proxy()
```
``` r
#> This maybe the first time proxy4you be load.
#> Please complete below configrations:)
#> Default setting can be accessed by Enter with nothing
#> [socks5 proxy] {Default as 127.0.0.1:7890} (address:port): 192.168.3.15:7890
#> [https proxy] {Default as 127.0.0.1:7890} (address:port):
#> [http proxy] {Default as 127.0.0.1:7890} (address:port):
#> Your setting have been save in ~/.Rproxy
```
## More
Check your IP
```{r check}
r.proxy::check_ip()
```
Test your connect
[speedtest](https://github.com/hrbrmstr/speedtest) will be used in this step
```{r test}
# install.packages("speedtest", repos = c("https://cinc.rud.is", "https://cloud.r-project.org/"))
speedtest::spd_test()
r.proxy::proxy()
speedtest::spd_test()
r.proxy::noproxy()
```