Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
DevAlone committed Jan 27, 2018
1 parent a6c7c1c commit 9c2847a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ proxy_py is a program which collects proxies, saves them in database and makes p

2 Install requirements

```
```bash
cd proxy_py
pip3 install -r requirements.txt
```
Expand All @@ -33,7 +33,7 @@ pip3 install -r requirements.txt

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:

```
```json
{
'model': 'proxy',
'method': 'get',
Expand All @@ -46,7 +46,7 @@ You can skip it. The required fields are model and method.

It will return json response like this:

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

Or error if something went wrong:

```
```json
{
'status': 'error',
'error_message': 'You should specify model',
Expand All @@ -87,7 +87,7 @@ Example using httpie:

Example using python requests library:

```
```python
import requests
import json

Expand All @@ -108,7 +108,7 @@ def get_proxies():
```
Example using aiohttp library:

```
```python
import aiohttp


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

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

```
```bash
proxy_py@server:~/proxy_py$ vim proxy_py/settings.py
```

```
```bash
DATABASE_CONNECTION_ARGS = (
'postgresql://USERNAME:PASSWORD@localhost/DB_NAME',
)
```

5 Copy supervisor config example and change it for your case

```
```bash
root@server:~$ cp /home/proxy_py/proxy_py/config_examples/proxy_py.supervisor.conf /etc/supervisor/conf.d/proxy_py.conf
root@server:~$ vim /etc/supervisor/conf.d/proxy_py.conf
```

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

```
```bash
root@server:~$ cp /home/proxy_py/proxy_py/config_examples/proxy_py.nginx.conf /etc/nginx/sites-available/proxy_py
root@server:~$ ln -s /etc/nginx/sites-available/proxy_py /etc/nginx/sites-enabled/
root@server:~$ vim /etc/nginx/sites-available/proxy_py
```

7 Restart supervisor and nginx

```
```bash
root@server:~$ supervisorctl reread
root@server:~$ supervisorctl update
root@server:~$ /etc/init.d/nginx configtest
Expand Down

0 comments on commit 9c2847a

Please sign in to comment.