Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
220143ae
Commit
220143ae
authored
Jan 08, 2015
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #211
parent
81a19c4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
src/main/scala/com/github/shadowsocks/utils/Parser.scala
src/main/scala/com/github/shadowsocks/utils/Parser.scala
+12
-8
No files found.
src/main/scala/com/github/shadowsocks/utils/Parser.scala
View file @
220143ae
...
@@ -52,17 +52,21 @@ object Parser {
...
@@ -52,17 +52,21 @@ object Parser {
if
(
uri
.
getScheme
==
Scheme
.
SS
)
{
if
(
uri
.
getScheme
==
Scheme
.
SS
)
{
val
encoded
=
data
.
replace
(
Scheme
.
SS
+
"://"
,
""
)
val
encoded
=
data
.
replace
(
Scheme
.
SS
+
"://"
,
""
)
val
content
=
new
String
(
Base64
.
decode
(
encoded
,
Base64
.
NO_PADDING
),
"UTF-8"
)
val
content
=
new
String
(
Base64
.
decode
(
encoded
,
Base64
.
NO_PADDING
),
"UTF-8"
)
val
info
=
content
.
split
(
'@'
)
val
methodIdx
=
content
.
indexOf
(
':'
)
val
encinfo
=
info
(
0
).
split
(
':'
)
val
passwordIdx
=
content
.
lastIndexOf
(
'@'
)
val
serverinfo
=
info
(
1
).
split
(
':'
)
val
hostIdx
=
content
.
lastIndexOf
(
':'
)
val
method
=
content
.
substring
(
0
,
methodIdx
)
val
password
=
content
.
substring
(
methodIdx
+
1
,
passwordIdx
)
val
host
=
content
.
substring
(
passwordIdx
+
1
,
hostIdx
)
val
port
=
content
.
substring
(
hostIdx
+
1
)
val
profile
=
new
Profile
val
profile
=
new
Profile
profile
.
name
=
serverinfo
(
0
)
profile
.
name
=
host
profile
.
host
=
serverinfo
(
0
)
profile
.
host
=
host
profile
.
remotePort
=
serverinfo
(
1
)
.
toInt
profile
.
remotePort
=
port
.
toInt
profile
.
localPort
=
1080
profile
.
localPort
=
1080
profile
.
method
=
encinfo
(
0
)
profile
.
method
=
method
profile
.
password
=
encinfo
(
1
)
profile
.
password
=
password
return
Some
(
profile
)
return
Some
(
profile
)
}
}
}
catch
{
}
catch
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment