Coder Social home page Coder Social logo

shadowsocks-windows's Introduction

[logo] Shadowsocks for Windows

Build Release

Features

  • Connect to Shadowsocks servers.
  • Automatically set system proxy.
  • SIP002 URL scheme.
  • SIP003 plugins.
  • SIP008 online configuration delivery.

Downloads

Download from releases.

Usage

  • 🚀

PAC

  • The PAC rules are generated from the geosite database in v2fly/domain-list-community.
  • Generation modes: whitelist mode and blacklist mode.
  • Domain groups: geositeDirectGroups and geositeProxiedGroups.
    • geositeDirectGroups is initialized with cn and geolocation-!cn@cn.
    • geositeProxiedGroups is initialized with geolocation-!cn.
  • To switch between different modes, modify the geositePreferDirect property in gui-config.json
    • When geositePreferDirect is false (default), PAC works in whitelist mode. Exception rules are generated from geositeDirectGroups. Unmatched domains goes through the proxy.
    • When geositePreferDirect is true, PAC works in blacklist mode. Blocking rules are generated from geositeProxiedGroups. Exception rules are generated from geositeDirectGroups. Unmatched domains are connected to directly.
  • Starting from 4.3.0.0, shadowsocks-windows defaults to whitelist mode with Chinese domains excluded from connecting via the proxy.
  • The new default values make sure that:
    • When in whitelist mode, Chinese domains, including non-Chinese companies' Chinese CDNs, are connected to directly.
    • When in blacklist mode, only non-Chinese domains goes through the proxy. Chinese domains, as well as non-Chinese companies' Chinese CDNs, are connected to directly.

User-defined rules

  • To define your own PAC rules, it's recommended to use the user-rule.txt file.
  • You can also modify pac.txt directly. But your modifications won't persist after updating geosite from the upstream.

Development

  • IDE: Visual Studio 2019
  • Language: C# 9.0
  • SDK: .NET 5

Build

  1. Clone the repository recursively.
$ git clone --recursive https://github.com/shadowsocks/shadowsocks-windows.git
  1. Open the repository in VS2019, switch to the Release configuration, and build the solution.

Contribute

PR welcome

You can use the Source Browser to review code online.

License

Shadowsocks-windows is licensed under the GPLv3 license.

BouncyCastle.NetCore (MIT)       https://github.com/chrishaly/bc-csharp
Caseless.Fody (MIT)              https://github.com/Fody/Caseless
Costura.Fody (MIT)               https://github.com/Fody/Costura
Fody (MIT)                       https://github.com/Fody/Fody
GlobalHotKey (GPLv3)             https://github.com/kirmir/GlobalHotKey
MdXaml (MIT)                     https://github.com/whistyun/MdXaml
Newtonsoft.Json (MIT)            https://www.newtonsoft.com/json
Privoxy (GPLv2)                  https://www.privoxy.org
ReactiveUI.WPF (MIT)             https://github.com/reactiveui/ReactiveUI
ReactiveUI.Events.WPF (MIT)      https://github.com/reactiveui/ReactiveUI
ReactiveUI.Fody (MIT)            https://github.com/reactiveui/ReactiveUI
ReactiveUI.Validation (MIT)      https://github.com/reactiveui/ReactiveUI.Validation
WPFLocalizationExtension (MS-PL) https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/
ZXing.Net (Apache 2.0)           https://github.com/micjahn/ZXing.Net

shadowsocks-windows's People

Contributors

adokevin avatar ahmadalli avatar breakwa11 avatar celeron533 avatar chenshaoju avatar clowwindy avatar damirainullin avatar database64128 avatar dependabot-preview[bot] avatar everyx avatar gangzhuo avatar hmbsbige avatar hyec avatar icylogic avatar jinliming2 avatar kimw avatar kookxiang avatar licshee avatar madeye avatar maikebing avatar mygod avatar noisyfox avatar rockenren avatar rwasef1830 avatar sinsinpub avatar stzx avatar tgsan avatar wongsyrone avatar wzxjohn avatar yifei0727 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

shadowsocks-windows's Issues

Add quick settings for PAC

It's not convenient to let user edit the PAC file now. Currently, we must do following steps when we found some website is blocked.

  1. Open PAC folder by clicking the context menu
  2. Open and edit PAC file (you need to find the specified places to add, and then close the pac file)

Is it possible to add an entry in the context menu and let users add block sites quickly? Here is scenario:

  1. User find some website is blocked and he want to add this website to PAC
  2. Click the context menu named "Add blocked site" (or give a hotkey), an window popup with an input textbox and Confirm/Cancel button on it.
  3. User added the site and click Confirm. Done.

Edit Pac File menu not works for me

It always to open explorer (an Library window).
I use QTTabBar 1024 Beta 2 on Win8.1, maybe it blocked the (hook explorer), but I suspect that is unstandard implementation cause this.

Problem with IPv6

server Ip中填入了服务器的IPV6地址不能正常运行,IPV4地址可以,是不是现阶段还不支持IPV6地址

Unit tests

  • Unit tests for each module
    • Models
    • Controllers
    • Views
    • Native modules
  • Blackbox tests for proxy connectivity

System Proxy for non LAN

不好意思,之前发错位置了。
1.win8.1自建的宽带连接,不能使用Shadowsocks-win-dotnet4.0-2.0.5版本的全局代理,切换至本地网络一切正常。
目前在宽带连接的情况下只能使用Proxy SwitchySharp。
2. 在本地网络连接情况下使用全局代理,禁用chrome的代理插件,网页什么的都能够正常打开,就是chrome的更新还是不行,好像chrome的更新没有走shadowsocks的全局代理。之前使用goagent全局也是这种情况,难道是chrome本身的更新机制有问题,目前只能在VPN下更新。

Stability Issues on .Net 4.0

我是由于是校园网 迅雷限速 故用 SS 作为代理下载文件……
嗯 今天更新了 dotnet4.0 版本的2.04 2.05 之后 在迅雷高并发下载时程序会很快崩溃
嗯 下载速度大概是 2000-5000kb 左右浮动 大概开始下载1分钟左右程序即会崩溃
但是dotnet2.0 的没有这个问题

Crash when Saving Configuration

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.NullReferenceException: 未将对象引用设置到对象的实例。
   在 Shadowsocks.Controller.ShadowsocksController.SaveConfig(Configuration newConfig)
   在 Shadowsocks.Controller.ShadowsocksController.SaveServers(List`1 servers)
   在 Shadowsocks.View.ConfigForm.OKButton_Click(Object sender, EventArgs e)
   在 System.Windows.Forms.Control.OnClick(EventArgs e)
   在 System.Windows.Forms.Button.OnClick(EventArgs e)
   在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
   在 System.Windows.Forms.Button.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** 已加载的程序集 **************
mscorlib
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5477 (Win7SP1GDR.050727-5400)
    基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Shadowsocks
    程序集版本: 2.0.9.0
    Win32 版本: 2.0.9.0
    基本代码: file:///D:/April/软件/fq/Shadowsocks-win-2.0.9/Shadowsocks.exe
----------------------------------------
System
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    基本代码: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5468 (Win7SP1GDR.050727-5400)
    基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
mscorlib.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5477 (Win7SP1GDR.050727-5400)
    基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Configuration
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5476 (Win7SP1GDR.050727-5400)
    基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5476 (Win7SP1GDR.050727-5400)
    基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Windows.Forms.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.5420 (Win7SP1.050727-5400)
    基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。

例如: 

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。

app.config 未找到

编译时报错

    错误  1   应用程序配置文件“app.config”无效。未能找到文件“D:\gfw\shadowsocks\shadowsocks-csharp\shadowsocks-csharp\app.config”。 D:\gfw\shadowsocks\shadowsocks-csharp\shadowsocks-csharp\app.config shadowsocks-csharp

将此文件(不存在)从项目中排除后正常编译。
环境为:Windows 8 Pro+Visual Studio 2012 Ultimate

CSS loading error in Internet Explorer

启用服务后,一些网站的部分 CSS 在 IE 中无法加载。

  • 有些是在 PAC 文件中指定的,如 Google Plus
    image
  • 有些是不需要 shadowsocks 转发的,如 Bing
    image

在使用 SwitchySharp 的 Chrome 浏览器中则一切正常。

Error occurs when shutdown the operating system without closing shadowsocks.

some information related show below

************** 异常文本 **************
System.InvalidOperationException: 进程(1984)已退出,因此无法处理请求。
在 System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
在 System.Diagnostics.Process.Kill()
在 Shadowsocks.Controller.PolipoRunner.Stop()
在 Shadowsocks.Controller.ShadowsocksController.Stop()
在 Shadowsocks.View.ConfigForm.ConfigForm_FormClosed(Object sender, FormClosedEventArgs e)
在 System.Windows.Forms.Form.OnFormClosed(FormClosedEventArgs e)
在 System.Windows.Forms.Form.WmClose(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

and I found where related code is. I will try to fix it.

Accessibility for the server list

Seems no accesskeys for OK and Cancel button, although can use Enter and Esc key.

Auto focus to Server IP box affect to select the server items using keyboard.
Such as: focus to Server IP box, press down arrow key, the focus be to server ip box, break the move process.

Proposal (any one):

  1. just focus to item, not switch unless press Enter key.
  2. Support the Ctrl+Up/Down or Alt+Up/Down hotkey.
  3. No the auto focus for keyboard.

Can not Load HTTPS Resources

导致出现类似 #22 的问题
很多的连接显示
(failed)
net::ERR_SSL_PROTOCOL_ERROR

SS-csharp版本 2.0.3 Chrome版本38.0.2125.111 m
不经过PAC,直接使用SOCKS5

Data Corruption

情况1
400 Bad Request等
Your browser sent a request that this server could not understand. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!

各种网站都有可能提示request header错误

情况2
偶尔还会弹出选择文件保存路径的窗口,即浏览器试图另存为网页

情况3
如图
default

通常刷新后解决
环境:没有使用PAC,直接手动配置为使用SOCKS5

may not closed correctly

System.Net.Sockets.SocketException: 由于以前的关闭调用,套接字在那个方向已经关闭,发送或接收数据的请求没有被接受。
在 System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
在 shadowsocks_csharp.Handler.pipeConnectionReceiveCallback(IAsyncResult ar)

Client did not Connect to Server

现象:当客户端配置好 Shadowsocks-csharp 后,设置浏览器使用 SOCKS5 代理并通过 Shadowsocks-csharp 访问网址,但是浏览器始终显示正在连接,然后超时。

通过分析 shadowsocks-csharp.exe 的进程TCP连接,发现浏览器已经与代理端口建立连接,但是 shadowsocks-csharp.exe 并未向指定的服务器地址发起连接。

screenshot

服务端:Shadowsocks (Python) 2.2.0
系统环境:Microsoft Windows 7 SP1 x64
源码版本:1.1.2( https://github.com/clowwindy/shadowsocks-csharp/tree/ffc8411c45fecb6421291aa6643c6c6e8963a994
编译环境:Microsoft Visual Studio Express 2012 SP4
编译日志:

1>------ 已启动全部重新生成: 项目: shadowsocks-csharp, 配置: Release x86 ------
1>D:\My Documents\GitHub\shadowsocks-csharp\shadowsocks-csharp\Encryptor.cs(250,21,250,26): warning CS0162: 检测到无法访问的代码
1>D:\My Documents\GitHub\shadowsocks-csharp\shadowsocks-csharp\Encryptor.cs(254,21,254,26): warning CS0162: 检测到无法访问的代码
1>D:\My Documents\GitHub\shadowsocks-csharp\shadowsocks-csharp\Encryptor.cs(267,21,267,26): warning CS0162: 检测到无法访问的代码
1>D:\My Documents\GitHub\shadowsocks-csharp\shadowsocks-csharp\Encryptor.cs(271,21,271,26): warning CS0162: 检测到无法访问的代码
1>  shadowsocks-csharp -> D:\My Documents\GitHub\shadowsocks-csharp\shadowsocks-csharp\bin\x86\Release\shadowsocks-csharp.exe
========== 全部重新生成: 成功 1 个,失败 0 个,跳过 0 个 ==========

运行日志:

Waiting for a connection...

谢谢。

Proxy error: 403 Forbidden port

在拥有固定公网IP的公司办公电脑上搭的Apache服务器,端口80,公司路由器设置虚拟服务器,公网端口映射的1003;同一台电脑搭的Shaddowsocks端口8388,虚拟服务器公网映射端口1008,结果就是我客户端连上Shadowsocks(公网IP:1008)后,浏览器访问主页(公网IP:1003),IE(8123 http端口)显示Proxy error: 403 Forbidden port,火狐用8123 http端口显示同样的错误,但是用1080 socks5端口访问正常。

Turning off proxy automatic configuration.

Is there any method for me to turn off Internet Explorer's 'Use automatic configuration script' feature. Unlike Shadowsocks GUI, this clients seems to enable the said option above periodically even when I do not want that to happen. I only used the proxy with the Firefox + FoxyProxy combo, and want all my IE traffic to not use my shadowsocks proxy.

Thanks.

Crash when received shutdown signal

https://www.v2ex.com/t/144934#r_1485918

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.InvalidOperationException: 进程(5060)已退出,因此无法处理请求。
在 System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
在 System.Diagnostics.Process.Kill()
在 Shadowsocks.Controller.PolipoRunner.Stop()
在 Shadowsocks.Controller.ShadowsocksController.Stop()
在 Shadowsocks.View.ConfigForm.ConfigForm_FormClosed(Object sender, FormClosedEventArgs e)
在 System.Windows.Forms.Form.OnFormClosed(FormClosedEventArgs e)
在 System.Windows.Forms.Form.WmClose(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow. OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)```

Problem loading pages

It sometimes does not load pages normally, closes the connection when %30 of page is loaded and i have to refresh the page couple of times to get it resolved.

RC4

如果服务端method 设置成“rc4”岂不悲剧。
希望改进哦。

I believe a 'reload' function is needed

Often my shadowsocks client just stops and make the internet connection stop, too. Now I can only restart the program to fix this. I think a 'reload' function or something similar will be handy.

Win32Exception during System Shutdown

************** 异常文本 **************
System.ComponentModel.Win32Exception: 拒绝访问。
在 System.Diagnostics.Process.Kill()
在 Shadowsocks.Controller.PolipoRunner.Stop()
在 Shadowsocks.Controller.ShadowsocksController.Stop()
在 Shadowsocks.View.ConfigForm.ConfigForm_FormClosed(Object sender, FormClosedEventArgs e)
在 System.Windows.Forms.Form.OnFormClosed(FormClosedEventArgs e)
在 System.Windows.Forms.Form.WmClose(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Win 7 x64, 2.0-2.0.6都存在这个问题。

rc4

First i would thank you for this useful application.., Could you please add rc4 to this GUI as well ? Or put me on the right direction to get it done....

Log Window

用习惯了Tunnelier以及GoAgent,因此很希望增加一个日志监控窗口,能够看到服务器连接情况及访问日志等信息。目前版本(2.0.6)的Show Logs功能太简单了,而且,没有实时日志。

Can not Receive Any Requests on Server

Shadowsocks started
无法访问已释放的对象。
对象名:“System.Net.Sockets.Socket”。
Shadowsocks started
无法访问已释放的对象。
对象名:“System.Net.Sockets.Socket”。
Shadowsocks started
无法访问已释放的对象。
对象名:“System.Net.Sockets.Socket”。
Shadowsocks started
无法访问已释放的对象。
对象名:“System.Net.Sockets.Socket”。
Shadowsocks started
无法访问已释放的对象。
对象名:“System.Net.Sockets.Socket”。
Shadowsocks started
无法访问已释放的对象。
对象名:“System.Net.Sockets.Socket”。
Shadowsocks started

a focus issue after #35

open server list, up/down key is normal, but there is no focus (dashed box).
click the blank on list, no visual feedback, but this time the up/down key will selected the last item.

Expected: click the blank should not change the focus (it seem to change the focus to the next item after last item).

Find or Found

The two "Find Shadowsocks icon in notification tray", I feel the should be "found".

Only Chrome Works with PAC

试了2.0.6和2.0.7,都无效。

查看IE的选项->连接->局域网设置,已设置了“使用自动配置脚本”为:

http://127.0.0.1:8090/pac?t=201411111654214169

在IE里打开上面的URL,也能正常下载PAC文件

telnet 设置好的本地端口,也能通。

chrome://net-internals/#proxy 信息如下:

Effective proxy settings

PAC script: http://127.0.0.1:8090/pac?t=201411111654214169
Source: SYSTEM

另外,怎么临时切换成全局走代理?因为有时候我想访问的网站没有在PAC文件里写入。

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.