-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix the error tip and add documentation
- Loading branch information
Showing
19 changed files
with
301 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
*.pyc | ||
*.pyo | ||
.DS* | ||
.pylint_rc | ||
/.idea | ||
/.project | ||
/.pydevproject | ||
/.settings | ||
Thumbs.db | ||
*~ | ||
.cache | ||
*.pyc | ||
*.pyo | ||
.DS* | ||
.pylint_rc | ||
/.idea | ||
/.project | ||
/.pydevproject | ||
/.settings | ||
Thumbs.db | ||
*~ | ||
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
language: python | ||
matrix: | ||
include: | ||
- python: "2.6" | ||
- python: "2.7" | ||
- python: "2.7.10" | ||
- python: "2.7.11" | ||
allow_failures: | ||
- python: "3.2" | ||
- python: "3.3" | ||
- python: "3.4" | ||
- python: "3.5" | ||
- python: "nightly" | ||
# command to install dependencies | ||
install: | ||
- pip install python-dateutil pytest | ||
# command to run tests | ||
script: py.test -v | ||
|
||
language: python | ||
matrix: | ||
include: | ||
- python: "2.6" | ||
- python: "2.7" | ||
- python: "2.7.10" | ||
- python: "2.7.11" | ||
allow_failures: | ||
- python: "3.2" | ||
- python: "3.3" | ||
- python: "3.4" | ||
- python: "3.5" | ||
- python: "nightly" | ||
|
||
# command to install dependencies | ||
install: | ||
- pip install python-dateutil pytest | ||
# command to run tests | ||
script: py.test -v | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2019 Guoqing Zhang <[email protected]> (conw.net) | ||
Copyright (c) 2019 Guoqing Zhang <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,40 @@ | ||
# Shadowsocks-kodi | ||
|
||
Run Shadowsocks on kodi! | ||
|
||
|
||
<p align="center"><a href="https://vuejs.org" target="_blank" rel="noopener noreferrer"><img width="200" src="https://github.com/conwnet/shadowsocks-kodi/raw/master/resources/icon.png" alt="Shadowsocks Kodi logo"></a></p> | ||
|
||
|
||
<h3 align="center"> | ||
Run Shadowsocks on Kodi! | ||
</h3> | ||
|
||
## Get Started | ||
|
||
You can download the latest version from [Github Releases](https://github.com/conwnet/shadowsocks-kodi/releases) | ||
|
||
1. Install the addon on your kodi. | ||
2. Configure your Shadowsocks. | ||
3. Restart services to take effect. | ||
|
||
## Check up | ||
|
||
You can login your kodi with ssh and display the ports usage. | ||
|
||
As shown below, we can see our Shadowsocks services running at PID 653. | ||
|
||
``` | ||
LibreELEC:~ # netstat -lntp | ||
Active Internet connections (only servers) | ||
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | ||
... | ||
tcp 0 0 127.0.0.1:1080 0.0.0.0:* LISTEN 653/kodi.bin | ||
... | ||
``` | ||
|
||
You can test whether your services work as your expected use `curl`. | ||
|
||
``` | ||
LibreELEC:~ # curl -x socks5://127.0.0.1:1080 ifconfig.io/ip | ||
``` | ||
|
||
## Screenshots | ||
|
||
![Shadowsocks kodi](./resources/screenshot-01.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<addon id="service.sslocal" name="Shadowsocks" version="0.0.1" provider-name="netcon"> | ||
<requires> | ||
<import addon="xbmc.python" version="2.24.0"/> | ||
|
||
<import addon="script.module.simplejson" version="3.3.0"/> | ||
</requires> | ||
<extension point="xbmc.service" library="main.py" start="startup"/> | ||
<extension point="xbmc.addon.metadata"> | ||
<summary>Shadowsocks Client</summary> | ||
<description></description> | ||
<language></language> | ||
<platform>linux</platform> | ||
<license>MIT</license> | ||
<forum></forum> | ||
<website>conw.net</website> | ||
<email>[email protected]</email> | ||
<source></source> | ||
<news></news> | ||
<disclaimer></disclaimer> | ||
<assets> | ||
<icon>resources/icon.png</icon> | ||
<fanart>resources/fanart.jpg</fanart> | ||
</assets> | ||
</extension> | ||
</addon> | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<addon id="service.shadowsocks" name="Shadowsocks" version="0.0.1" provider-name="netcon"> | ||
<requires> | ||
<import addon="xbmc.python" version="2.24.0"/> | ||
</requires> | ||
<extension point="xbmc.service" library="main.py" start="startup"/> | ||
<extension point="xbmc.addon.metadata"> | ||
<summary>Shadowsocks for Kodi</summary> | ||
<description> | ||
Usage: | ||
1. Click `Configure` to fill in your server config | ||
2. Click `Disable` to stop existing service | ||
3. Click `Enable` to start service with the current config | ||
|
||
You have already established a SOCKS5 proxy on your kodi! | ||
Github: https://github.com/conwnet/shadowsocks-kodi | ||
</description> | ||
<language></language> | ||
<platform>linux</platform> | ||
<license>MIT</license> | ||
<forum></forum> | ||
<website>conw.net</website> | ||
<email>[email protected]</email> | ||
<source></source> | ||
<news></news> | ||
<disclaimer></disclaimer> | ||
<assets> | ||
<icon>resources/icon.png</icon> | ||
<fanart>resources/fanart.jpg</fanart> | ||
<screenshot>resources/screenshot-01.png</screenshot> | ||
<screenshot>resources/screenshot-02.png</screenshot> | ||
<screenshot>resources/screenshot-03.png</screenshot> | ||
</assets> | ||
</extension> | ||
</addon> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
v0.0.1 | ||
v0.0.1 | ||
- Initial version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# run service | ||
|
||
from resources import service | ||
|
||
if __name__ == '__main__': | ||
service.run() | ||
|
||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# run service | ||
|
||
from src import service, async_task, helpers | ||
import logging | ||
import xbmc | ||
|
||
# set logging to xbmc.log | ||
def set_logging(): | ||
class Handler(logging.Handler): | ||
def __init__(self): | ||
logging.Handler.__init__(self) | ||
def emit(self, record): | ||
message = self.format(record) | ||
xbmc.log(message, level=xbmc.LOGNOTICE) | ||
|
||
logger = logging.getLogger() | ||
logger.addHandler(Handler()) | ||
|
||
if __name__ == '__main__': | ||
set_logging() | ||
config = helpers.get_config() | ||
|
||
def run_service(): | ||
if not config['server']: | ||
return | ||
service.run(config) | ||
|
||
task = async_task.AsyncTask(run_service, config['pid-file']) | ||
|
||
# try stop existing process, | ||
# on normal case it not required | ||
task.stop() | ||
task.start() | ||
|
||
monitor = xbmc.Monitor() | ||
while not monitor.abortRequested(): | ||
if monitor.waitForAbort(10): | ||
task.stop() | ||
break |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<settings> | ||
<category label="Necessary"> | ||
<setting label="Necessary Parameters" type="lsep" /> | ||
<setting label="SERVER_ADDR" id="server_addr" type="text" /> | ||
<setting label="SERVER_PORT" id="server_port" type="number" default="8388" /> | ||
<setting label="METHOD" id="method" type="select" default="aes-256-cfb" values="aes-128-gcm|aes-192-gcm|aes-256-gcm|aes-128-cfb|aes-192-cfb|aes-256-cfb|aes-128-ctr|aes-192-ctr|aes-256-ctr|camellia-128-cfb|camellia-192-cfb|camellia-256-cfb|bf-cfb|chacha20-ietf-poly1305|xchacha20-ietf-poly1305|salsa20|chacha20|chacha20-ietf|rc4-md5" /> | ||
<setting label="PASSWORD" id="password" type="text" option="hidden" default="" /> | ||
</category> | ||
<category label="Optional"> | ||
<setting label="Optional Parameters" type="lsep" /> | ||
<setting label="LOCAL_ADDR" id="local_addr" type="text" default="127.0.0.1" /> | ||
<setting label="LOCAL_PORT" id="local_port" type="number" default="1080" /> | ||
<setting label="TIMEOUT" id="timeout" type="number" default="300" /> | ||
<setting label="ONE_TIME_AUTH" id="one_time_auto" type="bool" default="false" /> | ||
<setting label="TCP_FASTOPEN" id="tcp_fast_open" type="bool" default="false" /> | ||
</category> | ||
</settings> | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<settings> | ||
<category label="Required"> | ||
<setting label="Required Parameters" type="lsep" /> | ||
<setting label="SERVER_ADDR" id="server_addr" type="text" /> | ||
<setting label="SERVER_PORT" id="server_port" type="number" default="8388" /> | ||
<setting label="METHOD" id="method" type="select" default="aes-256-cfb" values="aes-128-gcm|aes-192-gcm|aes-256-gcm|aes-128-cfb|aes-192-cfb|aes-256-cfb|aes-128-ctr|aes-192-ctr|aes-256-ctr|camellia-128-cfb|camellia-192-cfb|camellia-256-cfb|bf-cfb|chacha20-ietf-poly1305|xchacha20-ietf-poly1305|salsa20|chacha20|chacha20-ietf|rc4-md5" /> | ||
<setting label="PASSWORD" id="password" type="text" option="hidden" default="" /> | ||
</category> | ||
<category label="Optional"> | ||
<setting label="Optional Parameters" type="lsep" /> | ||
<setting label="LOCAL_ADDR" id="local_addr" type="text" default="127.0.0.1" /> | ||
<setting label="LOCAL_PORT" id="local_port" type="number" default="1080" /> | ||
<setting label="TIMEOUT" id="timeout" type="number" default="300" /> | ||
<setting label="ONE_TIME_AUTH" id="one_time_auto" type="bool" default="false" /> | ||
<setting label="TCP_FASTOPEN" id="tcp_fast_open" type="bool" default="false" /> | ||
</category> | ||
</settings> |
File renamed without changes.
Oops, something went wrong.