Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
haoqu.ma
/
gotty
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8f951823
authored
Aug 22, 2017
by
Iwasaki Yudai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show command in log
1 parent
c1ccfdd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
main.go
server/server.go
main.go
View file @
8f95182
...
@@ -3,8 +3,10 @@ package main
...
@@ -3,8 +3,10 @@ package main
import
(
import
(
"context"
"context"
"fmt"
"fmt"
"log"
"os"
"os"
"os/signal"
"os/signal"
"strings"
"syscall"
"syscall"
"github.com/codegangsta/cli"
"github.com/codegangsta/cli"
...
@@ -93,6 +95,8 @@ func main() {
...
@@ -93,6 +95,8 @@ func main() {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
gCtx
,
gCancel
:=
context
.
WithCancel
(
context
.
Background
())
gCtx
,
gCancel
:=
context
.
WithCancel
(
context
.
Background
())
log
.
Printf
(
"GoTTY is starting with command: %s"
,
strings
.
Join
(
args
,
" "
))
errs
:=
make
(
chan
error
,
1
)
errs
:=
make
(
chan
error
,
1
)
go
func
()
{
go
func
()
{
errs
<-
srv
.
Run
(
ctx
,
server
.
WithGracefullContext
(
gCtx
))
errs
<-
srv
.
Run
(
ctx
,
server
.
WithGracefullContext
(
gCtx
))
...
...
server/server.go
View file @
8f95182
...
@@ -107,7 +107,7 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error {
...
@@ -107,7 +107,7 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error {
return
errors
.
Wrapf
(
err
,
"failed to setup an HTTP server"
)
return
errors
.
Wrapf
(
err
,
"failed to setup an HTTP server"
)
}
}
log
.
Printf
(
"
GoTTY server is start
ing at: %s"
,
url
.
String
())
log
.
Printf
(
"
HTTP server is listen
ing at: %s"
,
url
.
String
())
if
server
.
options
.
Address
==
"0.0.0.0"
{
if
server
.
options
.
Address
==
"0.0.0.0"
{
for
_
,
address
:=
range
listAddresses
()
{
for
_
,
address
:=
range
listAddresses
()
{
log
.
Printf
(
"Alternative URL: %s"
,
server
.
setupURL
(
address
,
path
)
.
String
())
log
.
Printf
(
"Alternative URL: %s"
,
server
.
setupURL
(
address
,
path
)
.
String
())
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment