Is there ShadowsocksR server in OpenWrt for x86/router?

Final goal is to setup a SSR server openwrt on a router in order for people in China to bypass GFW.

Want to know if it has already been developed in openwrt.

Thanks.

Package available for shadowsocks and redsocks, I recall helping someone port a version of redsocks as well.

https://openwrt.org/packages/table/start?dataflt[Name_pkg-dependencies*~]=socks

https://forum.openwrt.org/search?q=shadowsocks

https://forum.openwrt.org/search?q=redsocks

Edit: Ah, missed "server" -- You probably want to host on an OS intended and tuned for multi-threaded operation and on hardware intended for higher loads than typical all-in-one routers provide.

Thanks.

But I'm looking for ShadowsocksR not Shadowsocks.

I already tested Shadowsocks on x86 but failed. However SSR server on ubuntu is working for my friend in China to bypass GFW. That why I'm asking if a SSR server version is available in openwrt x86/router.

afaik, ssr is not packaged in openwrt package feeds, only shadowsocks-libev.

That's why I want some help from developers if it is possible to include it in openwrt.

Thanks.

For software with limited audience, inclusion requires someone with the willingness to package the upstream distribution, test, and provide ongoing maintenance and support. This often does not require “C skills”, but mainly an attention to detail.

Thanks Jeff.

I'd like to do it myself but don't know where/how to start.

Could you provide some info/documents which can guide me to the right direction?

I did compile some package which involving some special device driver. But there is no "SSR" choice in menuconfig before compile.

https://openwrt.org/docs/guide-developer/packages

I'd look at something similar as a "template" to start with.

As a first step, you could use whatever config file the package uses, before trying to create it with UCI.

Thanks Jeff.

So in theory, any application software can be packaged to openwrt?

If you have source code that builds on Linux 4.14 (or whatever the current kernel is), "in theory", yes.

There's always the question of if it makes sense to do so, or if an OS designed to handle larger applications rather than optimized for limited flash and limited RAM would be a better choice.

There are some "challenges" with some application software as, for one, the C libraries used for tiny devices often don't have all the calls, and all the functionality of those calls, that application software requires. Other challenges are that most application software assumes "infinite memory" by all-in-one router measures. An app may expect to be able to allocate, "oh, just 64 MB" of memory -- which is more than some devices that people are still trying to run OpenWrt on have, in total.

Thanks Jeff.

My plan is to use a router with SSR-Server on openwrt. Then it can run 24/7. When I travel to China, I have a channel to bypass GFW block.

Found someting below:

Is it enough to do it?

It looks like it is reasonably active, with commits in late 2018, so I'd say it's worth a try

Edit:

Looks like the server was removed, but at least the framework for the Makefile and the patches seem like a good starting point.

Thanks Jeff.

My thought is to test in openwrt x86 first.

Install openwrt x86 in a VM. Then try to install SSR-Server in the openwrt environment?

Or compile and build the openwrt x86 img with SSR-Server inside?
eg:

use ar71xx platform as example

tar xjf OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2

Where to find such file for x86 PC?

https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm

Set up a "snapshot" x86_64 image, to make sure that your VM works as you'd expect.

https://openwrt.org/docs/guide-developer/build-system/install-buildsystem

Select x86_64 under target and go from there

I mean the *.tar.bz2 file for x86 platform not VM.

Given that you're developing and building your own package, I'd strongly suggest the full build system (linked above) rather than a pre-built SDK

If you're looking for a pre-compiled OpenWrt image, check http://downloads.openwrt.org/snapshots/targets/x86/64/

Thanks Jeff.

I need lots of reading now. I'm still not clear what to do, like step 1. xxxx step 2. xxxxx ...

I did compile x86 openwrt with LEDE17. But that one is relative simple. I can choose target, app like ss-server in menuconfig. But ssr-server not in the list in menuconfig.

I think the problem is how to make ssr-server available in the menuconfig list. Is it right?

I need a full ubuntu system?

I use Debian, but Ubuntu works as well. You only need a command-line installation -- no "graphical user interface" required. I'll typically install sudo and make sure sshd is enabled, so I can log in from another machine, especially if I'm using a VM to build.

It sounds like you've got a build system going, but let me know if you need more help.

The basic steps (once the prereqs are installed) are, from memory

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a  # Might get errors about unresolved dependences, run again and they should clear
make menuconfig  # and select the x86_64 target
                 # selecting Developer options, use ccache can speed your builds a lot
make -jN clean download world

Once that is running and you can confirm that the image runs on your "test" VM, then add the package according to the instructions.

git clone https://github.com/paulgit/openwrt-shadowsocksr.git package/feeds/shadowsocksr-libev

Hopefully it will show up in make menuconfig -- if it doesn't try removing the OpenWrt ./tmp/ directory and its contents. (That is not your build system's /tmp/, though that shouldn't kill you if you make that mistake.) Build to make sure it is "clean"

Go into that package's directory and checkout a git branch of your own, and start making the changes you might need to update the source as well as restore the server function.