Skip to content

Commit

Permalink
Merge branch 'release/0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lparam committed Apr 3, 2015
2 parents 344e8d7 + f4c9522 commit 850569f
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
v0.1.0 (2015-4-03)
-----------
* The first public version.

42 changes: 24 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

MAJOR = 0
MINOR = 1
PATCH = 0
PATCH = 1
NAME = xsocks

ifdef O
Expand All @@ -25,21 +25,21 @@ BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
endif # ifneq ($(BUILD_DIR),)

INSTALL_DIR := /usr/local/bin

OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
SRCTREE := $(CURDIR)
TOPDIR := $(SRCTREE)
export TOPDIR SRCTREE OBJTREE
export SRCTREE OBJTREE

#########################################################################

# CROSS_COMPILE = mips-openwrt-linux-

ifdef CROSS
CROSS_COMPILE = $(CROSS)
endif

ifdef CROSS_COMPILE
CPPFLAGS += -DCROSS_COMPILE
CPPFLAGS = -DCROSS_COMPILE
HOST = $(patsubst %-,%,$(CROSS_COMPILE))
endif

CFLAGS = \
Expand All @@ -48,9 +48,7 @@ CFLAGS = \
-Wall \
$(PLATFORM_CFLAGS)

CFLAGS += -ffunction-sections -fdata-sections
#CFLAGS += -g

CFLAGS += -fomit-frame-pointer -fdata-sections -ffunction-sections
EXTRA_CFLAGS =

#########################################################################
Expand All @@ -63,32 +61,36 @@ LDFLAGS += -pthread -ldl -lrt
LDFLAGS += 3rd/libuv/.libs/libuv.a 3rd/libsodium/src/libsodium/.libs/libsodium.a

#########################################################################
include $(TOPDIR)/config.mk
include $(SRCTREE)/config.mk
#########################################################################

ifndef CROSS_COMPILE
all: libuv libsodium c-ares xsocksd xsocks xtproxy xforwarder xtunnel
else
all: libuv libsodium xsocks xtproxy xforwarder xtunnel
endif

3rd/libuv/autogen.sh:
$(Q)git submodule update --init

3rd/libuv/Makefile: | 3rd/libuv/autogen.sh
$(Q)cd 3rd/libuv && ./autogen.sh && ./configure --host=$(patsubst %-,%,$(CROSS_COMPILE)) && $(MAKE)
$(Q)cd 3rd/libuv && ./autogen.sh && ./configure --host=$(HOST) LDFLAGS= && $(MAKE)

libuv: 3rd/libuv/Makefile

3rd/libsodium/autogen.sh:
$(Q)git submodule update --init

3rd/libsodium/Makefile: | 3rd/libsodium/autogen.sh
$(Q)cd 3rd/libsodium && ./autogen.sh && ./configure --host=$(patsubst %-,%,$(CROSS_COMPILE)) && $(MAKE)
$(Q)cd 3rd/libsodium && ./autogen.sh && ./configure --host=$(HOST) LDFLAGS= && $(MAKE)

libsodium: 3rd/libsodium/Makefile

3rd/c-ares/configure:
$(Q)git submodule update --init

3rd/c-ares/Makefile: | 3rd/c-ares/configure
$(Q)cd 3rd/c-ares && ./buildconf && ./configure --host=$(patsubst %-,%,$(CROSS_COMPILE)) && $(MAKE)
$(Q)cd 3rd/c-ares && ./buildconf && ./configure --host=$(HOST) LDFLAGS= && $(MAKE) MAKEFLAGS=-rRs

c-ares: 3rd/c-ares/Makefile

Expand Down Expand Up @@ -178,9 +180,13 @@ distclean: clean
$(Q)cd 3rd/libuv && make distclean
$(Q)cd 3rd/c-ares && make distclean

ifndef CROSS_COMPILE
install:
$(Q)cp xsocksd $(INSTALL_DIR)
$(Q)cp xsocks $(INSTALL_DIR)
$(Q)cp xtproxy $(INSTALL_DIR)
$(Q)cp xforwarder $(INSTALL_DIR)
$(Q)cp xtunnel $(INSTALL_DIR)
else
install:
$(Q)cp xsocksd /usr/local/bin
$(Q)cp xsocks /usr/local/bin
$(Q)cp xtproxy /usr/local/bin
$(Q)cp xforwarder /usr/local/bin
$(Q)cp xtunnel /usr/local/bin
endif
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ make && sudo make install
# At OpenWRT build root
cd package
git clone https://github.com/xsocks/xsocks.git
cd ..

# Build the package
make package/xsocks/openwrt/compile
Expand Down
21 changes: 11 additions & 10 deletions openwrt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=xsocks
PKG_VERSION:=0.1.0
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_RELEASE=1

PKG_SOURCE_URL:=https://github.com/lparam/xsocks/archive
PKG_SOURCE:=v$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Ken <ken.i18n@gmail.com>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/lparam/xsocks.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=v$(PKG_VERSION)

PKG_INSTALL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1

PKG_MAINTAINER:=Ken <ken.i18n@gmail.com>

include $(INCLUDE_DIR)/package.mk

Expand All @@ -29,14 +30,14 @@ define Package/xsocks
endef

define Package/xsocks/description
xsocks is a secure and fast proxy for protect your network traffic
xsocks is a secure and fast proxy for protect your network traffic
endef

define Package/xsocks/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/xsocks.init $(1)/etc/init.d/xsocks
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/x{socks,tproxy,forwarder,tunnel} $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/x{socks,tproxy,forwarder,tunnel} $(1)/usr/bin
endef

$(eval $(call BuildPackage,xsocks))
8 changes: 4 additions & 4 deletions openwrt/files/xsocks.init
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
START=72
STOP=30
FIREWALL_RELOAD=0
SERVER=server:port
PASSWORD=password
SERVER=IP:PORT
PASSWORD=PASSWORD

start() {
xsocks -l 0.0.0.0:1080 -s $SERVER -k $PASSWORD -n -V
xtproxy -l 0.0.0.0:1070 -s $SERVER -k $PASSWORD -n -V
xsocks -s $SERVER -k $PASSWORD -n -V
xtproxy -s $SERVER -k $PASSWORD -n -V
xforwarder -l localhost:5533 -t 8.8.8.8:53 -s $SERVER -k $PASSWORD -n -V
}

Expand Down
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "uv.h"

#define XSOCKS_VERSION "0.1.0"
#define XSOCKS_VERSION "0.1.1"

struct server_context {
int index;
Expand Down

0 comments on commit 850569f

Please sign in to comment.