Commit Graph
351 Commits
Author SHA1 Message Date
noisyfox be3cc3f3a6 Rename Shadowsocks.Proxy -> Shadowsocks.ForwardProxy 2016-12-09 02:17:46 +11:00
noisyfox 264b91d6b0 Fix a problem that forward proxy settings are saved twice
Fix #926
2016-12-09 02:05:42 +11:00
noisyfox 4b067346bf Refine random string generate. 2016-12-09 01:39:07 +11:00
noisyfox 983c1adb28 Check secret in PACServer 2016-12-08 18:54:57 +11:00
noisyfox 22d8cdeff7 Add secret in local pac url. 2016-12-08 18:13:22 +11:00
noisyfox b6cd8e0750 Update CHANGES and bump version 2016-12-06 22:43:19 +11:00
noisyfox cc6f77efa5 Refine code 2016-12-06 22:34:17 +11:00
noisyfox 65b9c9f5fa Allow check pre-release version 2016-12-06 22:01:00 +11:00
Syrone Wong 1e7a8de34a Fix privoxy listening port conflict (#920)
Let TCP stack find a free port for us

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-12-03 03:00:31 +11:00
Syrone Wong 355ab0e63d Use UTF-8 encoding for optional tag in ss url (#918)
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-12-01 00:31:03 +11:00
noisyfox 17c60bf9cc Don't UpdateSystemProxy before SaveConfig.
Otherwise we will update proxy twice.
2016-11-23 03:46:14 +11:00
noisyfox 41827f283e Refine code 2016-11-23 03:22:00 +11:00
noisyfox e7b559f1da Refine code 2016-11-23 02:42:12 +11:00
noisyfox 63816ccdd1 Fix hotkey unregister issue.
Use singleton mode for hotkey callbacks.
2016-11-23 02:34:07 +11:00
noisyfox b63bab0d1a Refine LogViewerConfig. Don't store window size in main settings file 2016-11-15 04:23:59 +11:00
noisyfox 4b49431800 Parse dest address before connect to SS server.
This gives us the possibility to chose SS server based on dest address.
2016-11-14 09:58:48 +11:00
noisyfox cfc6e674da Catch and log known exceptions in SystemProxy 2016-11-12 19:38:47 +11:00
noisyfox 0101aa3741 Merge branch 'master' of https://github.com/shadowsocks/shadowsocks-windows 2016-11-12 19:23:33 +11:00
Noisyfox bce876f42e Merge pull request #869 from wongsyrone/master
Refine RNG usage
2016-11-09 22:35:17 +11:00
Syrone Wong 8fcb66b6ff Refine RNG usage
- Create instance once, bind it to ShadowsocksController

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-11-09 10:28:50 +08:00
noisyfox da6466e247 Improve exception handling 2016-11-08 18:49:09 +11:00
noisyfox 24db6438bd Update CHANGES and bump version 2016-11-07 16:52:28 +11:00
Syrone Wong 89b7043a4e Update CHANGES and bump version
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-10-21 09:57:08 +08:00
Syrone Wong 4b99a5c210 Make registry opening more generic
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-10-20 08:05:25 +08:00
Syrone Wong a12ae96443 Update CHANGES and bump version
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-10-10 13:53:45 +08:00
Syrone Wong 04ed25e16f Add timeout support for server and forward proxy
Also, fix typo in ProxyForm

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-10-06 21:03:45 +08:00
Syrone Wong 70bff7d7cc Use wininet API to setup system proxy
Get rid of tricky registry handling

Several files come from https://code.msdn.microsoft.com/windowsapps/CSWebBrowserWithProxy-c8535715/view/SourceCode

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-10-06 16:12:35 +08:00
Syrone Wong f910400449 Update CHANGES and bump version
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-10-03 18:58:45 +08:00
Syrone Wong 13ebb5ef01 Fix RegistryKey dispose
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-10-01 06:53:43 +08:00
Syrone Wong 41eb43b54e Drop retry connect
Shadowsocks don't need to reconnect, which is the software's
responsibility to retry.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-29 16:39:58 +08:00
Syrone Wong 46d95e7411 Get rid of lock(this)
- Use readonly object as lock

Info from stackoverflow:

If I want to be sure that it will be locked for all threads inside my
application:
The lock object has to be static, if it locks access to static state.
Otherwise it has to be instance, because there's no need to lock state of
one class instance, and prevent other threads to work with another class
instance at the same time.

everyone says that the object has to be "readonly" I didn't found the
reason
Well, it doesn't have to be. This is just a best practice, which helps you
to avoid errors.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-29 16:39:58 +08:00
Syrone Wong d5f24df128 Don't suppress exceptions
It is better to log them.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-29 16:38:54 +08:00
Syrone Wong a0fd003099 Close connection in the caller if exception is caught
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-29 16:38:24 +08:00
Syrone Wong 4bd9fd8a6b Replace treewide polipo with privoxy
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-28 16:35:51 +08:00
Noisyfox 35fc73b58b Add HTTP proxy support in forward proxy (#745)
* Add HTTP proxy support in forward proxy

Signed-off-by: noisyfox <timemanager.rick@gmail.com>

* Typo

* Throw exception if forward proxy not supported.
2016-09-24 23:37:24 -05:00
Syrone Wong b8c5f8e331 Update CHANGES and bump version
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-20 14:54:57 +08:00
noisyfox 063cf111cb Fix a bug that a TCPHandler may be shutdown immediately
after creation.

Becuase we put handler.Start() call after timeout check and
lastActivity is initialized in Start(), this will lead to a
incorrect timeout.

Also because we will call handler.Start() right after the
constructor and timeout check, so it makes no difference
where we put the initializtion of lastActivity. We won't do
this again in Start() because DateTime.Now will consumes a
lot of cpu time.
2016-09-17 16:21:03 +10:00
noisyfox 390144351a Fix #710
When using http proxy, this will cause distinct latency
if we are trying to resolve localhost.

Currently it's unnecessary to do that because our privoxy
doesn't listern on ipv6 address, so it's ok to hard code
the ipv4 address.

There is a plan to add a cache to record the ipv6 connectivity
so that we needn't to try both ipv4 and ipv6 every time when we
attempt to connect a DnsEndPoint.
2016-09-17 16:13:12 +10:00
noisyfox 2a12ac5578 Merge branch 'master' of https://github.com/shadowsocks/shadowsocks-windows.git 2016-09-17 14:57:54 +10:00
Syrone Wong 99bdec334c Add global hotkey support (#724)
Design:

Use the plain string for both config and hotkey parsing
and make use of KeyConverter, ModifierKeysConverter
to make it more rubust.

Find corresponding label (to display operation result) and callback (to do the real work) based on textbox name. In this case, they should be named as `<Feature-Name><Control-Name>`.

ShowLogsTextBox,
ShowLogsLabel,
ShowLogsCallback.

If this requirement doesn't meet, throw an exception at runtime.

Logic:

How to input keys:
1. put focus in the corresponding textbox
2. press the key combination you want to use
3. when you think it is ready, release all keys
4. the textbox shows your input

How to change keys:
1. put focus in the corresponding textbox
2. press BackSpace to clear content
3. re-input new one

How to deactivate:
1. clear content in the textbox
2. press OK button

Meaning of label color:
- Green: this combination is not occupied by other programs and register successfully
- Yellow: this combination is occupied by other programs and you have to change to another one
- Transparent without color: initial status

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-16 23:42:16 -05:00
Syrone Wong 6e6be823ad Fix #710 by @breakwa11
- Drop irrelevant changes
- Closes #723

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-16 13:33:14 +08:00
Syrone Wong 33b2ca8c8a Refactor
- Only use one instance of LogForm

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-16 00:47:05 +08:00
Syrone Wong d3c6039c61 Refine Proxy config
- Move to seperate model

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-14 23:19:39 +08:00
noisyfox 05063f074a Fix an issue that the socket may not be released.
- New wrapper to handle tcp socket connection.
- Fix some memory leak.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-09-14 04:23:18 +10:00
Syrone Wong 4b6d641d17 Update CHANGES and bump version
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-09 17:48:22 +08:00
破娃酱 59c315d465 new traffic chart style (#704)
* new traffic chart style
- remove invoke
- force to set AxisY.Maximum not zero
- format LogForm.cs

* avoid data race
2016-09-08 15:24:46 +08:00
破娃酱 da234ef857 add Traditional Chinese (#698)
* add Traditional Chinese

* fix a resource type

* fix the Traditional Chinese name of "address", "port", "screen", "Open Location"
2016-09-06 11:39:05 +08:00
noisyfox e364457b1b Fix a memory leak.
Caused by not call SocketAsyncEventArgs.Dispose().
2016-09-03 15:17:16 +08:00
noisyfox 0266ad9d59 Remove redundant lock.
Lock is evil.

This will actually affect the accuracy of GetDelta because
inboundDelta and outboundDelta may be calculated based on
the data collected at different time (eg. UpdateOutbound
get called before Interlocked.Read(ref _outbound)).

But that's not a problem. We can tolerate this little
inaccuracy. Besides, the _inbound, _outbound, _lastInbound
and _lastOutbound will be totally good because we use Interlocked.
2016-09-03 08:57:30 +08:00
Syrone Wong f70b177e56 Misc
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-29 21:30:05 +08:00