Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Primitive Domain Socket Support described in https://github.com/v2ray/Planning/issues/25 #1019

Merged
merged 31 commits into from
Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
71c3e81
Rebase: Add domainsocket receiver config
xiaokangwang Feb 12, 2018
d845b4c
Created listener file
xiaokangwang Oct 31, 2017
c3cdd90
fix and generate protobuf
xiaokangwang Oct 31, 2017
fdfa49d
modify golang package name
xiaokangwang Oct 31, 2017
5a7c49f
Added Generated error helper
xiaokangwang Nov 3, 2017
a6612a2
Regenerate Pb
xiaokangwang Nov 3, 2017
8fe5326
Added function Stub
xiaokangwang Nov 3, 2017
b9dddd0
Added Dialer stub
xiaokangwang Nov 22, 2017
7afd26a
Type switch for UnixReceiver
xiaokangwang Dec 28, 2017
7b51a56
Fix pb err
xiaokangwang Dec 28, 2017
7f34cbd
Add Generated Files
xiaokangwang Dec 28, 2017
5e0ed59
added function stub for UnixReceiverHandler Instancer
xiaokangwang Dec 28, 2017
91f32cc
Auto Gen
xiaokangwang Feb 12, 2018
43abfc9
Unix listeners(sync commit)
xiaokangwang Mar 11, 2018
8e5063d
(Sync Commit)
xiaokangwang Mar 16, 2018
3b1f0ae
finish transport listener
xiaokangwang Mar 18, 2018
3e05a35
finish UnixInboundHandler
xiaokangwang Mar 18, 2018
09bf78a
notify progressTraffic to quit
xiaokangwang Mar 18, 2018
a00c076
Pass unused data into Receiver
xiaokangwang Mar 28, 2018
b67cd22
Test and bug fix
xiaokangwang Mar 29, 2018
c51830b
Added UnixSenderConfig
xiaokangwang Apr 4, 2018
7e96581
Added integration
xiaokangwang Apr 4, 2018
176a5c0
generalize interface
xiaokangwang Apr 4, 2018
d08929a
finish up dial
xiaokangwang Apr 5, 2018
4e609c9
Added Test for dial
xiaokangwang Apr 5, 2018
8b881d7
Rename to prevent confusion
xiaokangwang Apr 5, 2018
12012cd
Testing and fixs
xiaokangwang Apr 5, 2018
c542c04
Merge branch 'master' of github.com:v2ray/v2ray-core into domainsocket
xiaokangwang Apr 5, 2018
8e1507a
Prevent unuseful test failure
xiaokangwang Apr 5, 2018
6d1faf5
Remove staging code
xiaokangwang Apr 5, 2018
00016e0
Add comment
xiaokangwang Apr 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Generated Files
  • Loading branch information
xiaokangwang committed Feb 12, 2018
commit 7f34cbdaff1b952bace2ba00412af5934dc9bc04
4 changes: 2 additions & 2 deletions app/dns/errors.generated.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dns
package server

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "DNS") }
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "DNS", "Server") }
4 changes: 1 addition & 3 deletions app/proxyman/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package proxyman

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("App", "Proxyman")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "Proxyman") }
4 changes: 1 addition & 3 deletions app/proxyman/inbound/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package inbound

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("App", "Proxyman", "Inbound")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "Proxyman", "Inbound") }
4 changes: 1 addition & 3 deletions app/proxyman/mux/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package mux

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("App", "Proxyman", "Mux")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "Proxyman", "Mux") }
4 changes: 1 addition & 3 deletions app/proxyman/outbound/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package outbound

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("App", "Proxyman", "Outbound")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("App", "Proxyman", "Outbound") }
236 changes: 119 additions & 117 deletions common/crypto/internal/chacha_core.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,124 @@ package internal

import "encoding/binary"

func ChaCha20Block(s *[16]uint32, out []byte, rounds int) {
var x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15 = s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9], s[10], s[11], s[12], s[13], s[14], s[15]
for i := 0; i < rounds; i += 2 {
var x uint32

x0 += x4
x = x12 ^ x0
x12 = (x << 16) | (x >> (32 - 16))
x8 += x12
x = x4 ^ x8
x4 = (x << 12) | (x >> (32 - 12))
x0 += x4
x = x12 ^ x0
x12 = (x << 8) | (x >> (32 - 8))
x8 += x12
x = x4 ^ x8
x4 = (x << 7) | (x >> (32 - 7))
x1 += x5
x = x13 ^ x1
x13 = (x << 16) | (x >> (32 - 16))
x9 += x13
x = x5 ^ x9
x5 = (x << 12) | (x >> (32 - 12))
x1 += x5
x = x13 ^ x1
x13 = (x << 8) | (x >> (32 - 8))
x9 += x13
x = x5 ^ x9
x5 = (x << 7) | (x >> (32 - 7))
x2 += x6
x = x14 ^ x2
x14 = (x << 16) | (x >> (32 - 16))
x10 += x14
x = x6 ^ x10
x6 = (x << 12) | (x >> (32 - 12))
x2 += x6
x = x14 ^ x2
x14 = (x << 8) | (x >> (32 - 8))
x10 += x14
x = x6 ^ x10
x6 = (x << 7) | (x >> (32 - 7))
x3 += x7
x = x15 ^ x3
x15 = (x << 16) | (x >> (32 - 16))
x11 += x15
x = x7 ^ x11
x7 = (x << 12) | (x >> (32 - 12))
x3 += x7
x = x15 ^ x3
x15 = (x << 8) | (x >> (32 - 8))
x11 += x15
x = x7 ^ x11
x7 = (x << 7) | (x >> (32 - 7))
x0 += x5
x = x15 ^ x0
x15 = (x << 16) | (x >> (32 - 16))
x10 += x15
x = x5 ^ x10
x5 = (x << 12) | (x >> (32 - 12))
x0 += x5
x = x15 ^ x0
x15 = (x << 8) | (x >> (32 - 8))
x10 += x15
x = x5 ^ x10
x5 = (x << 7) | (x >> (32 - 7))
x1 += x6
x = x12 ^ x1
x12 = (x << 16) | (x >> (32 - 16))
x11 += x12
x = x6 ^ x11
x6 = (x << 12) | (x >> (32 - 12))
x1 += x6
x = x12 ^ x1
x12 = (x << 8) | (x >> (32 - 8))
x11 += x12
x = x6 ^ x11
x6 = (x << 7) | (x >> (32 - 7))
x2 += x7
x = x13 ^ x2
x13 = (x << 16) | (x >> (32 - 16))
x8 += x13
x = x7 ^ x8
x7 = (x << 12) | (x >> (32 - 12))
x2 += x7
x = x13 ^ x2
x13 = (x << 8) | (x >> (32 - 8))
x8 += x13
x = x7 ^ x8
x7 = (x << 7) | (x >> (32 - 7))
x3 += x4
x = x14 ^ x3
x14 = (x << 16) | (x >> (32 - 16))
x9 += x14
x = x4 ^ x9
x4 = (x << 12) | (x >> (32 - 12))
x3 += x4
x = x14 ^ x3
x14 = (x << 8) | (x >> (32 - 8))
x9 += x14
x = x4 ^ x9
x4 = (x << 7) | (x >> (32 - 7))
}
binary.LittleEndian.PutUint32(out[0:4], s[0]+x0)
binary.LittleEndian.PutUint32(out[4:8], s[1]+x1)
binary.LittleEndian.PutUint32(out[8:12], s[2]+x2)
binary.LittleEndian.PutUint32(out[12:16], s[3]+x3)
binary.LittleEndian.PutUint32(out[16:20], s[4]+x4)
binary.LittleEndian.PutUint32(out[20:24], s[5]+x5)
binary.LittleEndian.PutUint32(out[24:28], s[6]+x6)
binary.LittleEndian.PutUint32(out[28:32], s[7]+x7)
binary.LittleEndian.PutUint32(out[32:36], s[8]+x8)
binary.LittleEndian.PutUint32(out[36:40], s[9]+x9)
binary.LittleEndian.PutUint32(out[40:44], s[10]+x10)
binary.LittleEndian.PutUint32(out[44:48], s[11]+x11)
binary.LittleEndian.PutUint32(out[48:52], s[12]+x12)
binary.LittleEndian.PutUint32(out[52:56], s[13]+x13)
binary.LittleEndian.PutUint32(out[56:60], s[14]+x14)
binary.LittleEndian.PutUint32(out[60:64], s[15]+x15)
func ChaCha20Block(s *[16]uint32, out []byte, rounds int) {
var x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15 = s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11],s[12],s[13],s[14],s[15]
for i := 0; i < rounds; i+=2 {
var x uint32

x0+=x4
x=x12^x0
x12=(x << 16) | (x >> (32 - 16))
x8+=x12
x=x4^x8
x4=(x << 12) | (x >> (32 - 12))
x0+=x4
x=x12^x0
x12=(x << 8) | (x >> (32 - 8))
x8+=x12
x=x4^x8
x4=(x << 7) | (x >> (32 - 7))
x1+=x5
x=x13^x1
x13=(x << 16) | (x >> (32 - 16))
x9+=x13
x=x5^x9
x5=(x << 12) | (x >> (32 - 12))
x1+=x5
x=x13^x1
x13=(x << 8) | (x >> (32 - 8))
x9+=x13
x=x5^x9
x5=(x << 7) | (x >> (32 - 7))
x2+=x6
x=x14^x2
x14=(x << 16) | (x >> (32 - 16))
x10+=x14
x=x6^x10
x6=(x << 12) | (x >> (32 - 12))
x2+=x6
x=x14^x2
x14=(x << 8) | (x >> (32 - 8))
x10+=x14
x=x6^x10
x6=(x << 7) | (x >> (32 - 7))
x3+=x7
x=x15^x3
x15=(x << 16) | (x >> (32 - 16))
x11+=x15
x=x7^x11
x7=(x << 12) | (x >> (32 - 12))
x3+=x7
x=x15^x3
x15=(x << 8) | (x >> (32 - 8))
x11+=x15
x=x7^x11
x7=(x << 7) | (x >> (32 - 7))
x0+=x5
x=x15^x0
x15=(x << 16) | (x >> (32 - 16))
x10+=x15
x=x5^x10
x5=(x << 12) | (x >> (32 - 12))
x0+=x5
x=x15^x0
x15=(x << 8) | (x >> (32 - 8))
x10+=x15
x=x5^x10
x5=(x << 7) | (x >> (32 - 7))
x1+=x6
x=x12^x1
x12=(x << 16) | (x >> (32 - 16))
x11+=x12
x=x6^x11
x6=(x << 12) | (x >> (32 - 12))
x1+=x6
x=x12^x1
x12=(x << 8) | (x >> (32 - 8))
x11+=x12
x=x6^x11
x6=(x << 7) | (x >> (32 - 7))
x2+=x7
x=x13^x2
x13=(x << 16) | (x >> (32 - 16))
x8+=x13
x=x7^x8
x7=(x << 12) | (x >> (32 - 12))
x2+=x7
x=x13^x2
x13=(x << 8) | (x >> (32 - 8))
x8+=x13
x=x7^x8
x7=(x << 7) | (x >> (32 - 7))
x3+=x4
x=x14^x3
x14=(x << 16) | (x >> (32 - 16))
x9+=x14
x=x4^x9
x4=(x << 12) | (x >> (32 - 12))
x3+=x4
x=x14^x3
x14=(x << 8) | (x >> (32 - 8))
x9+=x14
x=x4^x9
x4=(x << 7) | (x >> (32 - 7))
}
binary.LittleEndian.PutUint32(out[0:4], s[0]+x0)
binary.LittleEndian.PutUint32(out[4:8], s[1]+x1)
binary.LittleEndian.PutUint32(out[8:12], s[2]+x2)
binary.LittleEndian.PutUint32(out[12:16], s[3]+x3)
binary.LittleEndian.PutUint32(out[16:20], s[4]+x4)
binary.LittleEndian.PutUint32(out[20:24], s[5]+x5)
binary.LittleEndian.PutUint32(out[24:28], s[6]+x6)
binary.LittleEndian.PutUint32(out[28:32], s[7]+x7)
binary.LittleEndian.PutUint32(out[32:36], s[8]+x8)
binary.LittleEndian.PutUint32(out[36:40], s[9]+x9)
binary.LittleEndian.PutUint32(out[40:44], s[10]+x10)
binary.LittleEndian.PutUint32(out[44:48], s[11]+x11)
binary.LittleEndian.PutUint32(out[48:52], s[12]+x12)
binary.LittleEndian.PutUint32(out[52:56], s[13]+x13)
binary.LittleEndian.PutUint32(out[56:60], s[14]+x14)
binary.LittleEndian.PutUint32(out[60:64], s[15]+x15)
}

4 changes: 1 addition & 3 deletions proxy/blackhole/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package blackhole

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "Blackhole")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "Blackhole") }
4 changes: 1 addition & 3 deletions proxy/dokodemo/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package dokodemo

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "Dokodemo")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "Dokodemo") }
4 changes: 1 addition & 3 deletions proxy/freedom/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package freedom

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "Freedom")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "Freedom") }
4 changes: 1 addition & 3 deletions proxy/shadowsocks/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package shadowsocks

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "Shadowsocks")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "Shadowsocks") }
4 changes: 1 addition & 3 deletions proxy/socks/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package socks

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "Socks")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "Socks") }
4 changes: 1 addition & 3 deletions proxy/vmess/encoding/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package encoding

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "VMess", "Encoding")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "VMess", "Encoding") }
4 changes: 1 addition & 3 deletions proxy/vmess/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package vmess

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "VMess")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "VMess") }
4 changes: 1 addition & 3 deletions proxy/vmess/inbound/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package inbound

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "VMess", "Inbound")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "VMess", "Inbound") }
4 changes: 1 addition & 3 deletions proxy/vmess/outbound/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package outbound

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Proxy", "VMess", "Outbound")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Proxy", "VMess", "Outbound") }
4 changes: 1 addition & 3 deletions transport/internet/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package internet

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Transport", "Internet")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Transport", "Internet") }
4 changes: 1 addition & 3 deletions transport/internet/headers/http/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package http

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Transport", "Internet", "Headers", "HTTP")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Transport", "Internet", "Headers", "HTTP") }
4 changes: 1 addition & 3 deletions transport/internet/kcp/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package kcp

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Transport", "Internet", "mKCP")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Transport", "Internet", "mKCP") }
4 changes: 1 addition & 3 deletions transport/internet/tcp/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package tcp

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Transport", "Internet", "TCP")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Transport", "Internet", "TCP") }
4 changes: 1 addition & 3 deletions transport/internet/tls/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package tls

import "v2ray.com/core/common/errors"

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).Path("Transport", "Internet", "TLS")
}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).Path("Transport", "Internet", "TLS") }
Loading