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
589b14d8
Unverified
Commit
589b14d8
authored
Apr 08, 2020
by
Danny Tuppeny
Committed by
GitHub
Apr 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a switch to use WebSockets for web debug proxy (#54083)
parent
981afe39
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
1 deletion
+24
-1
devfs_web.dart
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
+5
-0
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+1
-0
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+2
-0
device.dart
packages/flutter_tools/lib/src/device.dart
+3
-0
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+9
-0
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+4
-1
No files found.
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
View file @
589b14d8
...
...
@@ -131,6 +131,7 @@ class WebAssetServer implements AssetReader {
String
hostname
,
int
port
,
UrlTunneller
urlTunneller
,
bool
useSseForDebugProxy
,
BuildMode
buildMode
,
bool
enableDwds
,
Uri
entrypoint
,
...
...
@@ -210,6 +211,7 @@ class WebAssetServer implements AssetReader {
},
urlEncoder:
urlTunneller
,
enableDebugging:
true
,
useSseForDebugProxy:
useSseForDebugProxy
,
serveDevTools:
false
,
logWriter:
(
Level
logLevel
,
String
message
)
=>
globals
.
printTrace
(
message
),
loadStrategy:
RequireStrategy
(
...
...
@@ -550,6 +552,7 @@ class WebDevFS implements DevFS {
@required
this
.
port
,
@required
this
.
packagesFilePath
,
@required
this
.
urlTunneller
,
@required
this
.
useSseForDebugProxy
,
@required
this
.
buildMode
,
@required
this
.
enableDwds
,
@required
this
.
entrypoint
,
...
...
@@ -562,6 +565,7 @@ class WebDevFS implements DevFS {
final
int
port
;
final
String
packagesFilePath
;
final
UrlTunneller
urlTunneller
;
final
bool
useSseForDebugProxy
;
final
BuildMode
buildMode
;
final
bool
enableDwds
;
final
bool
testMode
;
...
...
@@ -623,6 +627,7 @@ class WebDevFS implements DevFS {
hostname
,
port
,
urlTunneller
,
useSseForDebugProxy
,
buildMode
,
enableDwds
,
entrypoint
,
...
...
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
589b14d8
...
...
@@ -423,6 +423,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
port:
hostPort
,
packagesFilePath:
packagesFilePath
,
urlTunneller:
urlTunneller
,
useSseForDebugProxy:
debuggingOptions
.
webUseSseForDebugProxy
,
buildMode:
debuggingOptions
.
buildInfo
.
mode
,
enableDwds:
_enableDwds
,
entrypoint:
globals
.
fs
.
file
(
target
).
uri
,
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
589b14d8
...
...
@@ -351,6 +351,7 @@ class RunCommand extends RunCommandBase {
initializePlatform:
boolArg
(
'web-initialize-platform'
),
hostname:
featureFlags
.
isWebEnabled
?
stringArg
(
'web-hostname'
)
:
''
,
port:
featureFlags
.
isWebEnabled
?
stringArg
(
'web-port'
)
:
''
,
webUseSseForDebugProxy:
featureFlags
.
isWebEnabled
&&
stringArg
(
'web-server-debug-protocol'
)
==
'sse'
,
webEnableExposeUrl:
featureFlags
.
isWebEnabled
&&
boolArg
(
'web-allow-expose-url'
),
webRunHeadless:
featureFlags
.
isWebEnabled
&&
boolArg
(
'web-run-headless'
),
webBrowserDebugPort:
browserDebugPort
,
...
...
@@ -376,6 +377,7 @@ class RunCommand extends RunCommandBase {
initializePlatform:
boolArg
(
'web-initialize-platform'
),
hostname:
featureFlags
.
isWebEnabled
?
stringArg
(
'web-hostname'
)
:
''
,
port:
featureFlags
.
isWebEnabled
?
stringArg
(
'web-port'
)
:
''
,
webUseSseForDebugProxy:
featureFlags
.
isWebEnabled
&&
stringArg
(
'web-server-debug-protocol'
)
==
'sse'
,
webEnableExposeUrl:
featureFlags
.
isWebEnabled
&&
boolArg
(
'web-allow-expose-url'
),
webRunHeadless:
featureFlags
.
isWebEnabled
&&
boolArg
(
'web-run-headless'
),
webBrowserDebugPort:
browserDebugPort
,
...
...
packages/flutter_tools/lib/src/device.dart
View file @
589b14d8
...
...
@@ -585,6 +585,7 @@ class DebuggingOptions {
this
.
hostname
,
this
.
port
,
this
.
webEnableExposeUrl
,
this
.
webUseSseForDebugProxy
=
true
,
this
.
webRunHeadless
=
false
,
this
.
webBrowserDebugPort
,
this
.
vmserviceOutFile
,
...
...
@@ -596,6 +597,7 @@ class DebuggingOptions {
this
.
port
,
this
.
hostname
,
this
.
webEnableExposeUrl
,
this
.
webUseSseForDebugProxy
=
true
,
this
.
webRunHeadless
=
false
,
this
.
webBrowserDebugPort
,
this
.
cacheSkSL
=
false
,
...
...
@@ -640,6 +642,7 @@ class DebuggingOptions {
final
String
port
;
final
String
hostname
;
final
bool
webEnableExposeUrl
;
final
bool
webUseSseForDebugProxy
;
/// Whether to run the browser in headless mode.
///
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
589b14d8
...
...
@@ -168,6 +168,15 @@ abstract class FlutterCommand extends Command<void> {
'will select a random open port on the host.'
,
hide:
hide
,
);
argParser
.
addOption
(
'web-server-debug-protocol'
,
allowed:
<
String
>[
'sse'
,
'ws'
],
defaultsTo:
'sse'
,
help:
'The protocol (SSE or WebSockets) to use for the debug service proxy '
'when using the Web Server device and Dart Debugger extension. '
'This is useful for editors/debug adapters that do not support debugging '
'over SSE (the default protocol for Web Server/Dart Debugger extension).'
,
hide:
hide
,
);
argParser
.
addFlag
(
'web-allow-expose-url'
,
defaultsTo:
false
,
help:
'Enables daemon-to-editor requests (app.exposeUrl) for exposing URLs '
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
589b14d8
...
...
@@ -376,6 +376,7 @@ void main() {
port:
0
,
packagesFilePath:
'.packages'
,
urlTunneller:
null
,
useSseForDebugProxy:
true
,
buildMode:
BuildMode
.
debug
,
enableDwds:
false
,
entrypoint:
Uri
.
base
,
...
...
@@ -445,6 +446,7 @@ void main() {
'localhost'
,
8123
,
(
String
url
)
=>
null
,
true
,
BuildMode
.
debug
,
true
,
Uri
.
file
(
'test.dart'
),
...
...
@@ -468,11 +470,12 @@ void main() {
expect
(
verbose
,
null
);
expect
(
enableDebugging
,
true
);
expect
(
enableDebugExtension
,
true
);
expect
(
useSseForDebugProxy
,
true
);
return
MockDwds
();
});
await
server
.
dispose
();
await
server
.
dispose
();
}));
}
...
...
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