Code Monkey home page Code Monkey logo

simple-obfs's Introduction

simple-obfs

Deprecated. Followed by v2ray-plugin.

Intro

Simple-obfs is a simple obfuscating tool, designed as plugin server of shadowsocks.

Current version: 0.0.5 | Changelog

Build

For Unix-like systems, especially Debian-based systems, e.g. Ubuntu, Debian or Linux Mint, you can build the binary like this:

# Debian / Ubuntu
sudo apt-get install --no-install-recommends build-essential autoconf libtool libssl-dev libpcre3-dev libev-dev asciidoc xmlto automake
# CentOS / Fedora / RHEL
sudo yum install gcc autoconf libtool automake make zlib-devel openssl-devel asciidoc xmlto libev-devel
# Arch
sudo pacman -Syu gcc autoconf libtool automake make zlib openssl asciidoc xmlto
# Alpine
apk add gcc autoconf make libtool automake zlib-dev openssl asciidoc xmlto libpcre32 libev-dev g++ linux-headers

git clone https://github.com/shadowsocks/simple-obfs.git
cd simple-obfs
git submodule update --init --recursive
./autogen.sh
./configure && make
sudo make install

Usage

For a detailed and complete list of all supported arguments, you may refer to the man pages of the applications, respectively.

Plugin mode with shadowsocks

Add respective item to --plugin and --plugin-opts arg or as value of plugin and plugin_opts in JSON.

On the client:

ss-local -c config.json --plugin obfs-local --plugin-opts "obfs=http;obfs-host=www.bing.com"

On the server:

ss-server -c config.json --plugin obfs-server --plugin-opts "obfs=http"

Standalone mode

On the client:

obfs-local -s server_ip -p 8139 -l 1984 --obfs http --obfs-host www.bing.com
ss-local -c config.json -s 127.0.0.1 -p 1984 -l 1080

On the server:

obfs-server -s server_ip -p 8139 --obfs http -r 127.0.0.1:8388
ss-server -c config.json -s 127.0.0.1 -p 8388

Coexist with an actual Web server

Only applicable on the server:

# HTTP only with plugin mode
ss-server -c config.json --plugin obfs-server --plugin-opts "obfs=http;failover=example.com:80"

# Both HTTP and HTTPS with standalone mode
obfs-server -s server_ip -p 80 --obfs http -r 127.0.0.1:8388 --failover example.com:80
obfs-server -s server_ip -p 443 --obfs tls -r 127.0.0.1:8388 --failover example.com:443

# suppose you have an HTTP webserver (apache/nginx/whatever) listening on localhost:8080 and HTTPS on 8443
# (you probably shouldn't expose these ports)
obfs-server -s server_ip -p 80 --obfs http -r 127.0.0.1:8388 --failover 127.0.0.1:8080
obfs-server -s server_ip -p 443 --obfs tls -r 127.0.0.1:8388 --failover 127.0.0.1:8443

License

Copyright (C) 2016 Max Lv <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

simple-obfs's People

Contributors

antmak avatar cokebar avatar cpu avatar ddosolitary avatar felixonmars avatar hdid avatar icpz avatar ipcjs avatar kimw avatar lbypatrick avatar linusyang avatar lrinqvq avatar madeye avatar meshkati avatar mrjeos avatar mygod avatar pexcn avatar rogers0 avatar sherlock-holo avatar sparanoid avatar t123yh avatar tommyjerrymairo avatar xiashali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-obfs's Issues

wrong version number

When I build simple-obfs in ./simple-obfs-0.0.2/, the version of obfs-server is still 0.0.1

root@hk-az:~# /usr/local/bin/obfs-server --help

simple-obfs 0.0.1

若在ss-libev服务端的config添加obfs参数,则无法使用低于1024的端口

例如:
{
"server":"0.0.0.0",
"server_port":443,
"local_port":1080,
"password":"1234",
"timeout":60,
"method":"chacha20-ietf-poly1305",
"plugin":"obfs-server",
"plugin_opts":"obfs=http"
}
这样的话,ss-libev便无法通过/etc/init.d/shadowsocks-libev start 或 systemctl start shadowsocks-libev启动;若通过ss-server后添加参数的方式,则可以启动,但客户端无法上网

若使用大于1024的端口,则能正常启动ss-libev,正常使用

如何能够在使用obfs的情况下使用低于1024的端口?

Compile error cant find -lev

git version:

checking for ev_loop_destroy in -lev... no
configure: error: Couldn't find libev. Try installing libev-dev[el].

I compile libev from source, and i am sure it is installed:

pkg-config --list-all
......
libev                     libev - High-performance event loop/event model

The released tar and zip of v0.0.3 are lacking of contents of libcork package

It may triggle an error.

> ./autogen.sh
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'auto'.
glibtoolize: copying file 'auto/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:13: installing 'auto/ar-lib'
configure.ac:10: installing 'auto/compile'
configure.ac:21: installing 'auto/config.guess'
configure.ac:21: installing 'auto/config.sub'
configure.ac:12: installing 'auto/install-sh'
configure.ac:12: installing 'auto/missing'
configure.ac:285: error: required file 'libcork/Makefile.in' not found
src/Makefile.am: installing 'auto/depcomp'
autoreconf: automake failed with exit status: 1

simple-obfs failed to handshake

Server端:

配置环境:
bandwagon openvz/ubuntu 16.04/shadowsocks-libev-server 2.6.1/最新编译的obfs-server
运行参数:
"server": "ip",
"local_address": "127.0.0.1",
"server_port": 443,
"local_port": 1080,
"password": "password",
"timeout": 300,
"method": "chacha20",
“plugin”: "obfs-server --obfs http"

Client端:

client: lede r2535/shadowsocks-libev 2.6.1/最新编译的obfs-local
运行参数:
由luci-app-shadowsocks设置,与server配置保持一致
"plugin": "obfs-local --obfs http --obfs-host www.baidu.com"

问题:

无论使用tls或者http.插件都提示failed to handshake,无法连接.

log:

2017-01-11 20:54:15 INFO: plugin "obfs-server --obfs tls" enabled
2017-01-11 20:54:15 INFO: initializing ciphers... chacha20
2017-01-11 20:54:15 INFO: tcp port reuse enabled
2017-01-11 20:54:15 INFO: listening at xxx.xxx.xxx.xxx:33045
2017-01-11 20:54:15 INFO: running from root user
2017-01-11 20:54:15 [simple-obfs] INFO: obfuscating enabled
2017-01-11 20:54:15 [simple-obfs] INFO: tcp port reuse enabled
2017-01-11 20:54:15 [simple-obfs] INFO: listening at xxx.xxx.xxx.xxx:443
2017-01-11 20:54:15 [simple-obfs] INFO: running from root user
2017-01-11 20:54:31 INFO: accept a connection
2017-01-11 20:54:31 ERROR: failed to handshake with xxx.xxx.xxx.xxx
2017-01-11 20:54:38 INFO: server_recv close the connection
2017-01-11 20:54:38 INFO: current server connection: 0
2017-01-11 20:55:11 INFO: accept a connection
2017-01-11 20:55:11 INFO: connect to xxx.xxx.xxx.xxx:443
2017-01-11 20:55:11 INFO: remote connected
2017-01-11 20:55:12 INFO: remote_recv close the connection
2017-01-11 20:55:12 INFO: current remote connection: 0
2017-01-11 20:55:12 INFO: current server connection: 0

How can i let "plugin obfs-server" always be running?

I success to apply obfs server, but how can i let it always run?

root@f:~# ss-server -c /etc/shadowsocks-libev/config.json --plugin obfs-server --plugin-opts "obfs=http"
2017-03-10 01:10:15 INFO: plugin "obfs-server" enabled
2017-03-10 01:10:15 INFO: initializing ciphers... chacha20-ietf
2017-03-10 01:10:15 INFO: tcp server listening at 127.0.0.1:33999
2017-03-10 01:10:15 INFO: running from root user
2017-03-10 01:10:15 [simple-obfs] INFO: obfuscating enabled
2017-03-10 01:10:15 [simple-obfs] INFO: tcp port reuse enabled
2017-03-10 01:10:15 [simple-obfs] INFO: listening at 0.0.0.0:443
2017-03-10 01:10:15 [simple-obfs] INFO: running from root user

Or, another way, how can i let it run when the server boot & reboot?

解决config.json 加入 "plugin": "obfs-server", "plugin_opts": "obfs=http" 之后,ss-server无法运行的方法

之所以无法运行,是因为 obfs-server 没有以root的身份运行 。
方法有两种:
1、把"server_port"设置为大于等于1024(默认能运行的应该都是这种情况)
2、让 obfs-server 以 root 的身份运行,具体这样做:
#which obfs-server (查找 obfs-server 这个文件的具体路径)
#chmod 4755 obfs-server的路径 (obfs-server属于root用户,这个命令就是让obfs-server以root的身份运行)

getpeername: Transport endpoint is not connected

# obfs-server -s 0.0.0.0 -p 8139 --obfs http -r 127.0.0.1:8388
$ obfs-local -s SERVER_IP -p 8139 -l 1984 --obfs http --obfs-host www.baidu.com

ss-local gets getpeername: Transport endpoint is not connected all the time after adding -p 1984. 😕

ss-server does not start immediately on boot

If I add plugin and plugin_opts as value in json, ss-server does not start immediately on boot, simple-obfs is the latest version today.

shadowsocks-libev.service - Shadowsocks-libev Default Server Service
Loaded: loaded (/lib/systemd/system/shadowsocks-libev.service; enabled)
Active: active (running) since Thu 2017-01-19 14:18:42 CST; 6min ago
Docs: man:shadowsocks-libev(8)
Main PID: 580 (ss-server)
CGroup: /system.slice/shadowsocks-libev.service
├─ 580 /usr/bin/ss-server -a root -c /etc/shadowsocks-libev/config.json -u
└─1042 obfs-server

Jan 19 14:18:42 f986bb8d-42b0 ss-server[580]: 2017-01-19 14:18:42 INFO: onetime authentication enabled
Jan 19 14:18:42 f986bb8d-42b0 ss-server[580]: 2017-01-19 14:18:42 INFO: plugin "obfs-server" enabled
Jan 19 14:18:42 f986bb8d-42b0 ss-server[580]: 2017-01-19 14:18:42 INFO: UDP relay enabled
Jan 19 14:18:42 f986bb8d-42b0 ss-server[580]: 2017-01-19 14:18:42 INFO: initializing ciphers... chacha20
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 INFO: tcp port reuse enabled
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 INFO: tcp server listening at 127.0.0.1:53526
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 INFO: udp port reuse enabled
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 INFO: udp server listening at 0.0.0.0:3389
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 INFO: running from root user
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 [simple-obfs] INFO: obfuscating enabled
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 [simple-obfs] INFO: tcp port reuse enabled
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 [simple-obfs] INFO: listening at 0.0.0.0:3389
Jan 19 14:22:09 localhost ss-server[580]: 2017-01-19 14:22:09 [simple-obfs] INFO: running from root user

make alpine linux APKBUILD

hi I want to make my simple-obfs package for my vps in alpine linux.but it did not end well.
here is the error

      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:20: error: possibly undefined macro: AC_DISABLE_SHARED
configure.ac:44: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1
configure: error: cannot find install-sh, install.sh, or shtool in auto "."/auto
make: *** No targets specified and no makefile found.  Stop.
>>> ERROR: simple-obfs: all failed

and here is my APKBUILD

# $Id$
# Maintainer: Felix Yan <[email protected]>
# Contributor: jiangxq <jiangxueqian at gmail dot com>
# Contributor: zh99998 <[email protected]>
# Contributor: 4679kun <admin at 4679 dot us>

pkgname=simple-obfs
pkgver=0.0.3
pkgrel=1
pkgdesc='A simple obfusacting tool designed as plugin server of shadowsocks'
arch="i686 x86_64"
url="https://github.com/shadowsocks/simple-obfs"
license="GPL"
depends="libsodium udns libev"
makedepends="git asciidoc xmlto"
source="simple-obfs-$pkgver.tar.gz::https://github.com/shadowsocks/simple-obfs/archive/v$pk

md5sums="7daebe04043402fa61616c958140c24e  simple-obfs-0.0.3.tar.gz"
sha256sums="350c22e138202868d5726cb55e3d71e9962aad3306988a9f746b80d0e8998a75  simple-obfs-0
sha512sums="1e2f1c5a32508426a58d4894a3623d10ff6add875137444cea9bda61d972f3d36bd8b477358f31e


build() {
  cd simple-obfs-$pkgver
  ./autogen.sh
 ./configure --prefix=/usr                        
  make                                                
}                                         
                                             
package() {
  cd simple-obfs   
  make DESTDIR="$pkgdir/" install
}       

any help would be appreciated
thanks

listen error for obfs-server

When I run: ss-server -c /etc/shadowsocks-libev/config.json --plugin obfs-server --plugin-opts "obfs=http"

It turned out:

2017-01-27 12:30:59 INFO: plugin "obfs-server" enabled
2017-01-27 12:30:59 INFO: initializing ciphers... chacha20
2017-01-27 12:30:59 INFO: using nameserver: 8.8.8.8
2017-01-27 12:30:59 INFO: tcp port reuse enabled
2017-01-27 12:30:59 INFO: tcp server listening at 127.0.0.1:34649
2017-01-27 12:30:59 INFO: running from root user
2017-01-27 12:30:59 [simple-obfs] INFO: obfuscating enabled
2017-01-27 12:30:59 [simple-obfs] INFO: tcp port reuse enabled
2017-01-27 12:30:59 [simple-obfs] ERROR: listen() error
2017-01-27 12:30:59 ERROR: plugin service exit unexpectedly

obfs host与obfs协议

有个问题 --obfs http(http可改别的协议吗) --obfs-host (后面可以加任意url吗) 谢谢

Seems simple-obfs failover doesn't work with WebSocket?

I was trying to use nginx as a reverse proxy for WebSocket tunnel (wstunnel). When using http failover provided by simple-obfs, the server will take very long (about 30) seconds. However, if I simply configure nginx to listen on port 80, the response will be instant.
Is it due to misconfiguration of nginx, or a bug of simple-obfs?

readme

example 打错了 应该是 on the client 您写成了one xdd

a problem of make

I have not install automake.
Some errors

root@ouyang:~/simple-obfs#./autogen.sh Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326. autoreconf: failed to run aclocal: No such file or directory

debian应该安装automake包修复此问题

failover不兼容chrome和firefox

ie和edeg正常
qq 20170216212814
firefox和chrome异常
qq 20170216212922

使用的命令是:
obfs-server -s server_ip -p 443 --obfs tls -r 127.0.0.1:8388 --failover 127.0.0.1:8443
版本都是用的新版
web服务器是nginx

ss-server: unrecognized option '--plugin-opts'

Server:Ubuntu 16.10
Client:Openwrt 15.05 on XiaoMi-Mini Router
Already installed simple-obfs in server end, client also.

When apply plugin-opts in server end:

root@f:~# ss-server -c config.json --plugin obfs-server --plugin-opts "obfs=http"
ss-server: unrecognized option '--plugin-opts'

shadowsocks-libev 2.4.8

  maintained by Max Lv <[email protected]> and Linus Yang <[email protected]>

  usage:

When check status:

root@f:~# /etc/init.d/shadowsocks-libev status
● shadowsocks-libev.service - Shadowsocks-libev Default Server Service
   Loaded: loaded (/lib/systemd/system/shadowsocks-libev.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-03-09 02:49:45 CST; 11min ago
     Docs: man:shadowsocks-libev(8)
 Main PID: 2228 (ss-server)
    Tasks: 1 (limit: 4915)
   Memory: 632.0K
      CPU: 495ms
   CGroup: /system.slice/shadowsocks-libev.service
           └─2228 /usr/bin/ss-server -a root -c /etc/shadowsocks-libev/config.json -u

Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: invalid password or cipher
Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: failed to handshake with 223.73.4.116
Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: invalid password or cipher
Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: failed to handshake with 223.73.4.116
Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: invalid password or cipher
Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: failed to handshake with 223.73.4.116
Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: invalid password or cipher
Mar 09 02:50:04 f ss-server[2228]:  2017-03-09 02:50:04 ERROR: failed to handshake with 223.73.4.116
Mar 09 02:50:19 f ss-server[2228]:  2017-03-09 02:50:19 ERROR: authentication error from 27.10.142.83
Mar 09 02:50:20 f ss-server[2228]:  2017-03-09 02:50:20 ERROR: authentication error from 221.207.37.96

So, How can i enable option '--plugin-opts ?

加载提示ERROR: Invalid config path

插件模式下加载obfs提示错误
sudo ss-server -c /etc/shadowsocks-libev/config.json --plugin obfs-server --plugin-opts "obfs=http"
2017-01-15 18:43:14 INFO: plugin "obfs-server" enabled
2017-01-15 18:43:14 INFO: initializing ciphers... chacha20
2017-01-15 18:43:14 INFO: tcp port reuse enabled
2017-01-15 18:43:14 INFO: tcp server listening at 127.0.0.1:60862
2017-01-15 18:43:14 INFO: running from root user
2017-01-15 18:43:14 [simple-obfs] ERROR: Invalid config path.
2017-01-15 18:43:14 ERROR: plugin service exit unexpectedly

sudo ss-server -c /etc/shadowsocks-libev/config.json
2017-01-15 18:45:53 INFO: initializing ciphers... chacha20
2017-01-15 18:45:53 INFO: tcp port reuse enabled
2017-01-15 18:45:53 INFO: tcp server listening at xxx.xxx.xxx.xxx:443
2017-01-15 18:45:53 INFO: running from root user

Log output is confusing

# ss-server
 2017-01-09 17:20:03 INFO: using tcp fast open
 2017-01-09 17:20:03 INFO: onetime authentication enabled
 2017-01-09 17:20:03 INFO: plugin "obfs-server -p 8139 --obfs http --fast-open" enabled
 2017-01-09 17:20:03 INFO: initializing ciphers... chacha20
 2017-01-09 17:20:03 INFO: tcp port reuse enabled
 2017-01-09 17:20:03 INFO: listening at 0.0.0.0:49078
 2017-01-09 17:20:03 INFO: running from root user
 2017-01-09 17:20:03 INFO: using tcp fast open
 2017-01-09 17:20:03 INFO: obfuscating enabled
 2017-01-09 17:20:03 INFO: tcp port reuse enabled
 2017-01-09 17:20:03 INFO: listening at 0.0.0.0:8139
 2017-01-09 17:20:03 INFO: running from root user
^C 2017-01-09 17:23:14 ERROR: plugin service exit unexpectedly

As you can see here that one can't distinguish between ss-server's log and obfs-server's log.

Btw why Ctrl+C will it show that error?

ERROR: plugin service exit unexpectedly

ss-server -A -u -c config.json

config.json
{
"server":"0.0.0.0",
"server_port":port,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":600,
"method":"chacha20",
"fast_open":false,
"plugin":"obfs-server",
"plugin_opts":"obfs=http"
}

最新版的 libev 和 obfs

How to use obfs-tls ?

文档值给出了http混淆的方法,请问tls混淆该如采用?要不要证书,client端要指定obfs-host参数吗?

vps cant start with obfs

echo "ss-server -s xxx -p 8981 -k xxx -m aes-256-cfb -u --plugin "obfs-server --obfs http" -f start" >> /etc/rc.local
its not work
but
remove obfs
echo "ss-server -s xxx -p 8981 -k xxx -m aes-256-cfb -u -f start" >> /etc/rc.local
its work now
how can i resolve

make error on CentOS 6.9

# make check

Making check in libcork
make[1]: Entering directory /root/tmp/simple-obfs/libcork' make[1]: Nothing to be done for check'.
make[1]: Leaving directory /root/tmp/simple-obfs/libcork' Making check in src make[1]: Entering directory /root/tmp/simple-obfs/src'
CC obfs_local-local.o
In file included from local.c:63:
local.h:26:16: error: ev.h: No such file or directory
In file included from local.c:63:
local.h:35: error: expected specifier-qualifier-list before ‘ev_io’
local.h:46: error: expected specifier-qualifier-list before ‘ev_io’
local.h:68: error: expected specifier-qualifier-list before ‘ev_io’
local.c:104: error: expected ‘)’ before ‘ev_io’
local.c:105: error: expected ‘)’ before ‘ev_io’
local.c:106: error: expected ‘)’ before ‘ev_io’
local.c:107: error: expected ‘)’ before ‘ev_io’
local.c:108: error: expected ‘)’ before ‘ev_io’
local.c:109: error: expected ‘)’ before ‘ev_signal’
local.c:117: error: expected ‘)’ before ‘remote_t’
local.c:119: error: expected ‘)’ before ‘server_t’
local.c:140: error: expected ‘)’ before ‘ev_timer’
cc1: warnings being treated as errors
local.c:240: error: ‘struct ev_loop’ declared inside parameter list
local.c:240: error: its scope is only this definition or declaration, which is probably not what you want
local.c: In function ‘free_connections’:
local.c:246: error: implicit declaration of function ‘close_and_free_server’
local.c:247: error: implicit declaration of function ‘close_and_free_remote’
local.c: At top level:
local.c:252: error: expected ‘)’ before ‘ev_io’
local.c:460: error: expected ‘)’ before ‘ev_io’
local.c:498: error: expected ‘)’ before ‘ev_timer’
local.c:515: error: expected ‘)’ before ‘ev_io’
local.c:590: error: expected ‘)’ before ‘ev_io’
local.c: In function ‘new_remote’:
local.c:667: error: ‘struct remote_ctx’ has no member named ‘connected’
local.c:668: error: ‘struct remote_ctx’ has no member named ‘connected’
local.c:670: error: ‘struct remote_ctx’ has no member named ‘remote’
local.c:671: error: ‘struct remote_ctx’ has no member named ‘remote’
local.c:673: error: implicit declaration of function ‘ev_io_init’
local.c:673: error: ‘struct remote_ctx’ has no member named ‘io’
local.c:673: error: ‘remote_recv_cb’ undeclared (first use in this function)
local.c:673: error: (Each undeclared identifier is reported only once
local.c:673: error: for each function it appears in.)
local.c:673: error: ‘EV_READ’ undeclared (first use in this function)
local.c:674: error: ‘struct remote_ctx’ has no member named ‘io’
local.c:674: error: ‘remote_send_cb’ undeclared (first use in this function)
local.c:674: error: ‘EV_WRITE’ undeclared (first use in this function)
local.c:675: error: implicit declaration of function ‘ev_timer_init’
local.c:675: error: ‘struct remote_ctx’ has no member named ‘watcher’
local.c:675: error: ‘remote_timeout_cb’ undeclared (first use in this function)
local.c:677: error: ‘struct remote_ctx’ has no member named ‘watcher’
local.c: At top level:
local.c:699: error: expected ‘)’ before ‘remote_t’
local.c: In function ‘new_server’:
local.c:726: error: ‘struct server_ctx’ has no member named ‘connected’
local.c:727: error: ‘struct server_ctx’ has no member named ‘connected’
local.c:729: error: ‘struct server_ctx’ has no member named ‘server’
local.c:730: error: ‘struct server_ctx’ has no member named ‘server’
local.c:737: error: ‘struct server_ctx’ has no member named ‘io’
local.c:737: error: ‘server_recv_cb’ undeclared (first use in this function)
local.c:737: error: ‘EV_READ’ undeclared (first use in this function)
local.c:738: error: ‘struct server_ctx’ has no member named ‘io’
local.c:738: error: ‘server_send_cb’ undeclared (first use in this function)
local.c:738: error: ‘EV_WRITE’ undeclared (first use in this function)
local.c: At top level:
local.c:769: error: expected ‘)’ before ‘server_t’
local.c: In function ‘create_remote’:
local.c:785: error: ‘listen_ctx_t’ has no member named ‘remote_num’
local.c:787: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:805: error: ‘listen_ctx_t’ has no member named ‘mptcp’
local.c:815: error: ‘listen_ctx_t’ has no member named ‘iface’
local.c:816: error: ‘listen_ctx_t’ has no member named ‘iface’
local.c:821: error: ‘listen_ctx_t’ has no member named ‘timeout’
local.c: At top level:
local.c:829: error: expected ‘)’ before ‘ev_signal’
local.c:845: error: expected ‘)’ before ‘ev_io’
local.c: In function ‘main’:
local.c:1190: error: ‘listen_ctx_t’ has no member named ‘remote_num’
local.c:1191: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:1192: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:1202: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:1204: error: ‘listen_ctx_t’ has no member named ‘timeout’
local.c:1205: error: ‘listen_ctx_t’ has no member named ‘iface’
local.c:1206: error: ‘listen_ctx_t’ has no member named ‘mptcp’
local.c:1209: error: storage size of ‘sigint_watcher’ isn’t known
local.c:1210: error: storage size of ‘sigterm_watcher’ isn’t known
local.c:1211: error: implicit declaration of function ‘ev_signal_init’
local.c:1211: error: ‘signal_cb’ undeclared (first use in this function)
local.c:1213: error: implicit declaration of function ‘ev_signal_start’
local.c:1213: error: ‘EV_DEFAULT’ undeclared (first use in this function)
local.c:1216: error: ‘ev_timer’ undeclared (first use in this function)
local.c:1216: error: expected ‘;’ before ‘parent_watcher’
local.c:1217: error: ‘parent_watcher’ undeclared (first use in this function)
local.c:1217: error: ‘parent_watcher_cb’ undeclared (first use in this function)
local.c:1218: error: implicit declaration of function ‘ev_timer_start’
local.c:1237: error: ‘listen_ctx_t’ has no member named ‘fd’
local.c:1239: error: ‘listen_ctx_t’ has no member named ‘io’
local.c:1239: error: ‘accept_cb’ undeclared (first use in this function)
local.c:1239: error: ‘EV_READ’ undeclared (first use in this function)
local.c:1240: error: implicit declaration of function ‘ev_io_start’
local.c:1240: error: ‘listen_ctx_t’ has no member named ‘io’
local.c:1267: error: implicit declaration of function ‘ev_run’
local.c:1274: error: implicit declaration of function ‘ev_io_stop’
local.c:1274: error: ‘listen_ctx_t’ has no member named ‘io’
local.c:1275: error: passing argument 1 of ‘free_connections’ from incompatible pointer type
local.c:240: note: expected ‘struct ev_loop *’ but argument is of type ‘struct ev_loop *’
local.c:1278: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:1278: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:1279: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:1279: error: ‘listen_ctx_t’ has no member named ‘remote_addr’
local.c:1285: error: implicit declaration of function ‘ev_signal_stop’
local.c:1210: error: unused variable ‘sigterm_watcher’
local.c:1209: error: unused variable ‘sigint_watcher’
make[1]: *** [obfs_local-local.o] Error 1
make[1]: Leaving directory `/root/tmp/simple-obfs/src'
make: *** [check-recursive] Error 1

It seems that there are some syntax errors in the source code.

Consider providing a docker build file?

The core project has docker build files which works pretty well and keep up with the release cycle.

However, it lacks this plugin.

I suppose this one could be done by simply replace some scripts with that docker file. For a general usage, consider providing a docker build file or some hint in README?

a simple-obfs bug

i am using Archlinux, ss-libev was intalled by sudo pacman -S shadowsocks-libev

simple-obfs was installed by

git clone https://github.com/shadowsocks/simple-obfs.git
cd simple-obfs
git submodule update --init --recursive
./autogen.sh
./configure --prefix==/usr && make
sudo make install

ss android apk was download in GOOGLE PLAY

my server config is

    "server":"0.0.0.0",
    "server_port": 443,
    "local_address": "127.0.0.1",
    "password":"password",
    "timeout":300,
    "method":"chacha20-ietf-poly1305",
    "fast_open": true,
    "udp":"false",
    "plugin":"obfs-server",
    "plugin_opts":"obfs=tls",
    "plugin_opts":"failover=127.0.0.1:8443",
    "workers": 1,
    "prefer_ipv6": true

nginx server is runing @ port 8443
now here is the question: i can visit "https://my.domain.com"

but when it failed to connet my server via ss android apk in my cellphone.

it just says connection closed by peer both in my cellphone and server

服务端和客户端设置要完全一样吗?

On the client:
obfs-local -s server_ip -p 8139 -l 1984 --obfs http --obfs-host www.baidu.com
ss-local -c config.json -s 127.0.0.1 -p 1984 -l 1080
On the server:
obfs-server -s server_ip -p 8139 --obfs http -r 127.0.0.1:8388
ss-server -c config.json -s 127.0.0.1 -p 8388
服务端是否需要--obfs-host
还有一个疑问obfs-server可以开多个端口吗?如果能怎么开?
谢谢

使用插件后,shadowsocks-android udp转发失效

服务端: shadowsocks-libev 2.6.2
客户端: shadowsocks-libev 2.6.2, shadowsocks-android 3.3.1 & 3.4.1

当使用服务端使用simple-obfs 插件(--plugin "obfs-server --obfs http")时:shadowsocks-android 开启udp转发无法连接;但是shadowsocks-libev 可以使用-u并且连上。
当使用服务端不使用simple-obfs 插件时:两种客户端都能使用udp。

About obfs-server -r option

I tried to use obfs-server but it only prints out usage information.
Then I ran this program in gdb and found that if -r option is not specified, this program will simply print out a usage message.

In /src/server.c,

// line 1127
        ...
        case 'r':
            dst_addr_str = optarg;
            break;
        ...

//  line 1234
    if (server_num == 0 || server_port == NULL || dst_addr_str == NULL) {
        usage();
        exit(EXIT_FAILURE);
    }

However, I didn't find any useful information in the man page. Also I can hardly tell what this option means from the usage string:

-r : Forward traffic to this remote server address.

BTW, can I pair obfs-local with an older ss-libev on the client side? Like does the aforementioned combination work with the latest ss-libev with obfs enabled on the server side?

Cygwin无法编译,请更新configure

已经手动编译了libsodium、libudns,并安装了,ss-libev 3.0顺利通过,但是simple-obfs的configure就是说找不到libsodium-dev、libudns

这是因为simple-obfs和ss-libev 3.0的configure不同导致的,手动编译的库安装位置全在/usr/local下,但是我指定了./configure --disable-documentation --includedir=/usr/local/include --libdir=/usr/local/lib,依旧不行报错。

ERROR: failed to resolve server name

I can run the obfs-server stand alone just fine, but when I run it as a plugin I get this error.

user@host ~/simple-obfs-0.0.2/src
$ /usr/sbin/ss-server.exe -m aes-128-gcm -p 444 -u -k password --plugin ./obfs-server.exe --plugin-opts "obfs=http"
2017-03-03 11:20:31 INFO: plugin "./obfs-server.exe" enabled
2017-03-03 11:20:31 INFO: UDP relay enabled
2017-03-03 11:20:31 INFO: initializing ciphers... aes-128-gcm
2017-03-03 11:20:32 INFO: tcp server listening at 127.0.0.1:62123
2017-03-03 11:20:32 INFO: udp server listening at *:444
2017-03-03 11:20:32 [simple-obfs] INFO: obfuscating enabled
2017-03-03 11:20:34 [simple-obfs] ERROR: failed to resolve server name, wait 2 seconds
2017-03-03 11:20:38 [simple-obfs] ERROR: failed to resolve server name, wait 4 seconds
2017-03-03 11:20:46 [simple-obfs] ERROR: failed to resolve server name, wait 8 seconds
2017-03-03 11:20:48 [simple-obfs] ERROR: failed to resolve server name, wait 16 seconds
2017-03-03 11:20:48 [simple-obfs] ERROR: failed to resolve server name, wait 32 seconds
2017-03-03 11:20:50 [simple-obfs] ERROR: failed to resolve server name, wait 64 seconds

在服务器上安装老是报错,无法编译安装

我用的是搬瓦工Centos 7 x86_64系统,按照”https://github.com/shadowsocks/simple-obfs“这里的方法操作不下十遍了,每次都是到sudo make install这一步提示同样的错误:

[root@localhost simple-obfs]# ./autogen.sh
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, auto'. libtoolize: copying file auto/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, m4'. libtoolize: copying file m4/libtool.m4'
libtoolize: copying file m4/ltoptions.m4' libtoolize: copying file m4/ltsugar.m4'
libtoolize: copying file m4/ltversion.m4' libtoolize: copying file m4/lt~obsolete.m4'
configure.ac:13: installing 'auto/ar-lib'
configure.ac:41: installing 'auto/compile'
configure.ac:21: installing 'auto/config.guess'
configure.ac:21: installing 'auto/config.sub'
configure.ac:12: installing 'auto/install-sh'
configure.ac:12: installing 'auto/missing'
libcork/Makefile.am: installing 'auto/depcomp'
[root@localhost simple-obfs]# ./configure --prefix==/usr && mak
configure: error: expected an absolute directory name for --prefix: =/usr
[root@localhost simple-obfs]# ./configure --prefix==/usr && make
configure: error: expected an absolute directory name for --prefix: =/usr
[root@localhost simple-obfs]# ./configure && make
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
./configure: line 6993: /usr/bin/file: No such file or directory
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for asciidoc... /usr/bin/asciidoc
checking for xmlto... /usr/bin/xmlto
checking for gzip... /usr/bin/gzip
checking for mv... /usr/bin/mv
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc and cc understand -c and -o together... yes
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for thread local storage (TLS) class... __thread
checking for C/C++ restrict keyword... __restrict
checking for netdb.h... yes
checking for library containing inet_ntop... none required
checking whether inet_ntop is declared... yes
checking for what kind of host... Linux
checking if compiler needs -Werror to reject unknown flags... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking if -fstack-protector and -fstack-protector-all are supported.... yes
configure: -fstack-protector enabled in CFLAGS
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for netdb.h... (cached) yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for net/if.h... yes
checking for linux/if.h... yes
checking for linux/netfilter_ipv4.h... yes
checking for linux/netfilter_ipv6/ip6_tables.h... yes
checking whether byte ordering is bigendian... no
checking for inline... inline
checking for ssize_t... yes
checking whether to enable assertions... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... (cached) yes
checking for uint16_t... yes
checking for uint8_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking for memset... yes
checking for select... yes
checking for setresuid... yes
checking for setreuid... yes
checking for strerror... yes
checking for getpwnam_r... yes
checking for setrlimit... yes
checking for connect in -lsocket... no
checking for malloc... yes
checking for memset... (cached) yes
checking for socket... yes
checking for sodium_init in -lsodium... no
configure: error: Couldn't find libsodium. Try installing libsodium-dev[el].
[root@localhost simple-obfs]# sudo make install
make: *** 没有规则可以创建目标“install”。 停止。
[root@localhost simple-obfs]#

这里很少有提到编译安装方面的问题,难道就我有这问题吗?烦请大神解惑!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.