Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
abdullh.alsoleman
Front-End
Commits
ba70e0e0
Unverified
Commit
ba70e0e0
authored
Oct 14, 2019
by
Mouad Debbar
Committed by
GitHub
Oct 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print correct hostname when web server is launched (#42531)
parent
8cc9a53e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
web_fs.dart
packages/flutter_tools/lib/src/build_runner/web_fs.dart
+5
-4
web_fs_test.dart
...ges/flutter_tools/test/general.shard/web/web_fs_test.dart
+2
-1
No files found.
packages/flutter_tools/lib/src/build_runner/web_fs.dart
View file @
ba70e0e0
...
@@ -209,6 +209,7 @@ class WebFs {
...
@@ -209,6 +209,7 @@ class WebFs {
};
};
// Initialize the dwds server.
// Initialize the dwds server.
final
String
effectiveHostname
=
hostname
??
_kHostName
;
final
int
hostPort
=
port
==
null
?
await
os
.
findFreePort
()
:
int
.
tryParse
(
port
);
final
int
hostPort
=
port
==
null
?
await
os
.
findFreePort
()
:
int
.
tryParse
(
port
);
final
Pipeline
pipeline
=
const
Pipeline
().
addMiddleware
((
Handler
innerHandler
)
{
final
Pipeline
pipeline
=
const
Pipeline
().
addMiddleware
((
Handler
innerHandler
)
{
...
@@ -279,10 +280,10 @@ class WebFs {
...
@@ -279,10 +280,10 @@ class WebFs {
final
BuildRunnerAssetHandler
assetHandler
=
BuildRunnerAssetHandler
(
final
BuildRunnerAssetHandler
assetHandler
=
BuildRunnerAssetHandler
(
daemonAssetPort
,
daemonAssetPort
,
kBuildTargetName
,
kBuildTargetName
,
hostname
??
_kHostN
ame
,
effectiveHostn
ame
,
hostPort
);
hostPort
);
dwds
=
await
dwdsFactory
(
dwds
=
await
dwdsFactory
(
hostname:
hostname
??
_kHostN
ame
,
hostname:
effectiveHostn
ame
,
assetHandler:
assetHandler
,
assetHandler:
assetHandler
,
buildResults:
filteredBuildResults
,
buildResults:
filteredBuildResults
,
chromeConnection:
()
async
{
chromeConnection:
()
async
{
...
@@ -309,13 +310,13 @@ class WebFs {
...
@@ -309,13 +310,13 @@ class WebFs {
Cascade
cascade
=
Cascade
();
Cascade
cascade
=
Cascade
();
cascade
=
cascade
.
add
(
handler
);
cascade
=
cascade
.
add
(
handler
);
cascade
=
cascade
.
add
(
assetServer
.
handle
);
cascade
=
cascade
.
add
(
assetServer
.
handle
);
final
HttpServer
server
=
await
httpMultiServerFactory
(
hostname
??
_kHostN
ame
,
hostPort
);
final
HttpServer
server
=
await
httpMultiServerFactory
(
effectiveHostn
ame
,
hostPort
);
shelf_io
.
serveRequests
(
server
,
cascade
.
handler
);
shelf_io
.
serveRequests
(
server
,
cascade
.
handler
);
final
WebFs
webFS
=
WebFs
(
final
WebFs
webFS
=
WebFs
(
client
,
client
,
server
,
server
,
dwds
,
dwds
,
'http://
$
_kHostN
ame
:
$hostPort
/'
,
'http://
$
effectiveHostn
ame
:
$hostPort
/'
,
assetServer
,
assetServer
,
buildInfo
.
isDebug
,
buildInfo
.
isDebug
,
flutterProject
,
flutterProject
,
...
...
packages/flutter_tools/test/general.shard/web/web_fs_test.dart
View file @
ba70e0e0
...
@@ -167,7 +167,7 @@ void main() {
...
@@ -167,7 +167,7 @@ void main() {
test
(
'Uses provided port number and hostname.'
,
()
=>
testbed
.
run
(()
async
{
test
(
'Uses provided port number and hostname.'
,
()
=>
testbed
.
run
(()
async
{
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
await
WebFs
.
start
(
final
WebFs
webFs
=
await
WebFs
.
start
(
skipDwds:
false
,
skipDwds:
false
,
target:
fs
.
path
.
join
(
'lib'
,
'main.dart'
),
target:
fs
.
path
.
join
(
'lib'
,
'main.dart'
),
buildInfo:
BuildInfo
.
debug
,
buildInfo:
BuildInfo
.
debug
,
...
@@ -177,6 +177,7 @@ void main() {
...
@@ -177,6 +177,7 @@ void main() {
port:
'1234'
,
port:
'1234'
,
);
);
expect
(
webFs
.
uri
,
contains
(
'foo:1234'
));
expect
(
lastPort
,
1234
);
expect
(
lastPort
,
1234
);
expect
(
lastAddress
,
contains
(
'foo'
));
expect
(
lastAddress
,
contains
(
'foo'
));
}));
}));
...
...
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