Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mtproto_proxy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mtproto_proxy
Commits
af584e23
Unverified
Commit
af584e23
authored
Sep 19, 2018
by
Сергей Прохоров
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to configure each listener's interface IP
parent
4eab3caa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
mtproto_proxy.app.src
src/mtproto_proxy.app.src
+6
-1
mtproto_proxy_app.erl
src/mtproto_proxy_app.erl
+5
-3
No files found.
src/mtproto_proxy.app.src
View file @
af584e23
...
...
@@ -30,10 +30,15 @@
%% {external_ip, "YOUR.SERVER.EXTERNAL.IP"},
%% Interface to listen for incoming connections
{ip, {0, 0, 0, 0}},
%% If not set, 0.0.0.0 will be used
{listen_ip, {0, 0, 0, 0}},
%% You can add as much as you want. Names and ports should be unique
{ports, [#{name => mtp_handler,
port => 1443,
%% You can tell it to listen on specific IP.
%% If not set, top-level listen_ip will be used.
%% listen_ip => {1, 2, 3, 4},
%% secret should be 32 hex chars [0-9a-f]
secret => <<"d0d6e111bada5511fcce9584deadbeef">>,
%% tag is what you get from @MTProxybot
...
...
src/mtproto_proxy_app.erl
View file @
af584e23
...
...
@@ -8,7 +8,7 @@
-
behaviour
(
application
).
%% Application callbacks
-
export
([
start
/
2
,
stop
/
1
]).
-
export
([
start
/
2
,
stop
/
1
,
start_proxy
/
1
]).
-
define
(
APP
,
mtproto_proxy
).
%%====================================================================
...
...
@@ -30,8 +30,10 @@ stop(_State) ->
%%====================================================================
%% Internal functions
%%====================================================================
start_proxy
(
#
{
name
:
=
Name
,
port
:
=
Port
,
secret
:
=
Secret
,
tag
:
=
Tag
})
->
ListenIp
=
application
:
get_env
(
?
APP
,
ip
,
{
0
,
0
,
0
,
0
}),
start_proxy
(
#
{
name
:
=
Name
,
port
:
=
Port
,
secret
:
=
Secret
,
tag
:
=
Tag
}
=
P
)
->
ListenIp
=
maps
:
get
(
listen_ip
,
P
,
application
:
get_env
(
?
APP
,
listen_ip
,
{
0
,
0
,
0
,
0
})),
NumAcceptors
=
application
:
get_env
(
?
APP
,
num_acceptors
,
60
),
MaxConnections
=
application
:
get_env
(
?
APP
,
max_connections
,
10240
),
Res
=
...
...
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