OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library http.server; | 5 library http.server; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/channel.dart'; |
| 11 import 'package:analysis_server/src/domain_context.dart'; |
| 12 import 'package:analysis_server/src/domain_server.dart'; |
| 13 import 'package:analysis_server/src/get_handler.dart'; |
9 import 'package:args/args.dart'; | 14 import 'package:args/args.dart'; |
10 | 15 |
11 import 'src/analysis_server.dart'; | |
12 import 'src/channel.dart'; | |
13 import 'src/domain_context.dart'; | |
14 import 'src/domain_server.dart'; | |
15 import 'src/get_handler.dart'; | |
16 | |
17 /** | 16 /** |
18 * Instances of the class [HttpServer] implement a simple HTTP server. The | 17 * Instances of the class [HttpServer] implement a simple HTTP server. The |
19 * primary responsibility of this server is to listen for an UPGRADE request and | 18 * primary responsibility of this server is to listen for an UPGRADE request and |
20 * to start an analysis server | 19 * to start an analysis server |
21 */ | 20 */ |
22 class HttpAnalysisServer { | 21 class HttpAnalysisServer { |
23 /** | 22 /** |
24 * The name of the application that is used to start a server. | 23 * The name of the application that is used to start a server. |
25 */ | 24 */ |
26 static const BINARY_NAME = 'server'; | 25 static const BINARY_NAME = 'server'; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 * server. | 172 * server. |
174 */ | 173 */ |
175 void _returnUnknownRequest(HttpRequest request) { | 174 void _returnUnknownRequest(HttpRequest request) { |
176 HttpResponse response = request.response; | 175 HttpResponse response = request.response; |
177 response.statusCode = HttpStatus.NOT_FOUND; | 176 response.statusCode = HttpStatus.NOT_FOUND; |
178 response.headers.add(HttpHeaders.CONTENT_TYPE, "text/plain"); | 177 response.headers.add(HttpHeaders.CONTENT_TYPE, "text/plain"); |
179 response.write('Not found'); | 178 response.write('Not found'); |
180 response.close(); | 179 response.close(); |
181 } | 180 } |
182 } | 181 } |
OLD | NEW |