Skip to content

Commit 9c2847a

Browse files
committed
readme
1 parent a6c7c1c commit 9c2847a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ proxy_py is a program which collects proxies, saves them in database and makes p
1010

1111
2 Install requirements
1212

13-
```
13+
```bash
1414
cd proxy_py
1515
pip3 install -r requirements.txt
1616
```
@@ -33,7 +33,7 @@ pip3 install -r requirements.txt
3333

3434
proxy_py has server based on aiohttp which is listening 127.0.0.1:55555(you can change it in settings file) and provides proxies. To get proxies you should send following json request:
3535

36-
```
36+
```json
3737
{
3838
'model': 'proxy',
3939
'method': 'get',
@@ -46,7 +46,7 @@ You can skip it. The required fields are model and method.
4646

4747
It will return json response like this:
4848

49-
```
49+
```json
5050
{
5151
'status': 'ok',
5252
'count': 1,
@@ -70,7 +70,7 @@ Note: All fields except *protocol*, *domain*, *port*, *auth_data*, *checking_per
7070

7171
Or error if something went wrong:
7272

73-
```
73+
```json
7474
{
7575
'status': 'error',
7676
'error_message': 'You should specify model',
@@ -87,7 +87,7 @@ Example using httpie:
8787

8888
Example using python requests library:
8989

90-
```
90+
```python
9191
import requests
9292
import json
9393

@@ -108,7 +108,7 @@ def get_proxies():
108108
```
109109
Example using aiohttp library:
110110

111-
```
111+
```python
112112
import aiohttp
113113

114114

@@ -150,34 +150,34 @@ If you made changes to code and want to check that you didn't break anything, go
150150

151151
4 create unprivileged user in postgresql database and add database authentication data to settings.py
152152

153-
```
153+
```bash
154154
proxy_py@server:~/proxy_py$ vim proxy_py/settings.py
155155
```
156156

157-
```
157+
```bash
158158
DATABASE_CONNECTION_ARGS = (
159159
'postgresql://USERNAME:PASSWORD@localhost/DB_NAME',
160160
)
161161
```
162162

163163
5 Copy supervisor config example and change it for your case
164164

165-
```
165+
```bash
166166
root@server:~$ cp /home/proxy_py/proxy_py/config_examples/proxy_py.supervisor.conf /etc/supervisor/conf.d/proxy_py.conf
167167
root@server:~$ vim /etc/supervisor/conf.d/proxy_py.conf
168168
```
169169

170170
6 Copy nginx config example, enable it and change if you need
171171

172-
```
172+
```bash
173173
root@server:~$ cp /home/proxy_py/proxy_py/config_examples/proxy_py.nginx.conf /etc/nginx/sites-available/proxy_py
174174
root@server:~$ ln -s /etc/nginx/sites-available/proxy_py /etc/nginx/sites-enabled/
175175
root@server:~$ vim /etc/nginx/sites-available/proxy_py
176176
```
177177

178178
7 Restart supervisor and nginx
179179

180-
```
180+
```bash
181181
root@server:~$ supervisorctl reread
182182
root@server:~$ supervisorctl update
183183
root@server:~$ /etc/init.d/nginx configtest

0 commit comments

Comments
 (0)