diff --git a/src/main/asciidoc/datagrams.adoc b/src/main/asciidoc/datagrams.adoc index b7418fe0b75..7c1285d4cb3 100644 --- a/src/main/asciidoc/datagrams.adoc +++ b/src/main/asciidoc/datagrams.adoc @@ -26,7 +26,7 @@ and NetClient (see above). === Creating a DatagramSocket -To use UDP you first need t create a {@link io.vertx.core.datagram.DatagramSocket}. It does not matter here if you only want to send data or send +To use UDP you first need to create a {@link io.vertx.core.datagram.DatagramSocket}. It does not matter here if you only want to send data or send and receive. [source,$lang] @@ -54,7 +54,7 @@ Sending packets is as easy as shown here: === Receiving Datagram packets If you want to receive packets you need to bind the {@link io.vertx.core.datagram.DatagramSocket} by calling -`listen(...)}` on it. +`listen(...)` on it. This way you will be able to receive {@link io.vertx.core.datagram.DatagramPacket}s that were sent to the address and port on which the {@link io.vertx.core.datagram.DatagramSocket} listens. diff --git a/src/main/asciidoc/http.adoc b/src/main/asciidoc/http.adoc index 577b3ace8a9..bac3277f670 100644 --- a/src/main/asciidoc/http.adoc +++ b/src/main/asciidoc/http.adoc @@ -562,7 +562,7 @@ Or use {@link io.vertx.core.http.HttpServerResponse#putTrailer}. If you were writing a web server, one way to serve a file from disk would be to open it as an {@link io.vertx.core.file.AsyncFile} and pipe it to the HTTP response. -Or you could load it it one go using {@link io.vertx.core.file.FileSystem#readFile} and write it straight to the response. +Or you could load it in one go using {@link io.vertx.core.file.FileSystem#readFile} and write it straight to the response. Alternatively, Vert.x provides a method which allows you to serve a file from disk or the filesystem to an HTTP response in one operation. @@ -580,7 +580,7 @@ Here's a very simple web server that serves files from the file system using sen ---- Sending a file is asynchronous and may not complete until some time after the call has returned. If you want to -be notified when the file has been written you can use {@link io.vertx.core.http.HttpServerResponse#sendFile(String)} +be notified when the file has been written you can use {@link io.vertx.core.http.HttpServerResponse#sendFile(String)}. Please see the chapter about <> for restrictions about the classpath resolution or disabling it. @@ -1020,7 +1020,7 @@ An {@link io.vertx.core.http.HttpClientRequest} instance is also a {@link io.ver You can pipe to it from any {@link io.vertx.core.streams.ReadStream} instance. -For, example, you could pipe a file on disk to a http request body as follows: +For, example, you could pipe a file on disk to an http request body as follows: [source,$lang] ---- @@ -1229,7 +1229,7 @@ Alternatively you can just parse the `Set-Cookie` headers yourself in the respon The client can be configured to follow HTTP redirections provided by the `Location` response header when the client receives: -* a `301`, `302`, `307` or `308` status code along with a HTTP GET or HEAD method +* a `301`, `302`, `307` or `308` status code along with an HTTP GET or HEAD method * a `303` status code, in addition the directed request perform an HTTP GET method Here's an example: @@ -1621,7 +1621,7 @@ NOTE: this only applies to the HTTP/2 protocol Connection {@link io.vertx.core.http.HttpConnection#close} closes the connection: - it closes the socket for HTTP/1.x -- a shutdown with no delay for HTTP/2, the {@literal GOAWAY} frame will still be sent before the connection is closed. * +- a shutdown with no delay for HTTP/2, the {@literal GOAWAY} frame will still be sent before the connection is closed. The {@link io.vertx.core.http.HttpConnection#closeHandler} notifies when a connection is closed. @@ -1660,7 +1660,7 @@ You can assign a number of event loop a client will use independently of the cli When several HTTP servers listen on the same port, vert.x orchestrates the request handling using a round-robin strategy. -Let's take a verticle creating a HTTP server such as: +Let's take a verticle creating an HTTP server such as: .io.vertx.examples.http.sharing.HttpServerVerticle [source,$lang] @@ -1912,7 +1912,7 @@ The addresses of the handlers are given by {@link io.vertx.core.http.WebSocket#b === Using a proxy for HTTP/HTTPS connections -The http client supports accessing http/https URLs via a HTTP proxy (e.g. Squid) or _SOCKS4a_ or _SOCKS5_ proxy. +The http client supports accessing http/https URLs via an HTTP proxy (e.g. Squid) or _SOCKS4a_ or _SOCKS5_ proxy. The CONNECT protocol uses HTTP/1.x but can connect to HTTP/1.x and HTTP/2 servers. Connecting to h2c (unencrypted HTTP/2 servers) is likely not supported by http proxies since they will support diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index 33d85f7bab6..995681600e6 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -903,7 +903,7 @@ may have not consumed the complete payload (the connection was cut before you we Vert.x uses an an address resolver for resolving host name into IP addresses instead of the JVM built-in blocking resolver. -An host name resolves to an IP address using: +A host name resolves to an IP address using: - the _hosts_ file of the operating system - otherwise DNS queries against a list of servers @@ -944,7 +944,7 @@ Failover still applies and will use the next server in the list. === Hosts mapping -The _hosts_ file of the operating system is used to perform an hostname lookup for an ipaddress. +The _hosts_ file of the operating system is used to perform a hostname lookup for an ipaddress. An alternative _hosts_ file can be used instead: @@ -968,8 +968,7 @@ on Linux, it can be configured to a specific value with {@link io.vertx.core.dns === MacOS configuration -MacOS has a specific native extension to get the name server configuration of the system based on -Apple's open source mDNSResponder. When this extension is not present, +MacOS has a specific native extension to get the name server configuration of the system based on https://opensource.apple.com/tarballs/mDNSResponder/[Apple's open source mDNSResponder]. When this extension is not present, Netty logs the following warning. ---- @@ -978,7 +977,7 @@ Netty logs the following warning. This extension is not required as its absence does not prevent Vert.x to execute, yet is *recommended*. -You can use add it to your classpath to improve the integration and remove the warning. +You can add it to your classpath to improve the integration and remove the warning. .Intel-based Mac [source,xml] @@ -1192,4 +1191,4 @@ directory and serves it from there. Do not use this setting in production, it ca Finally, you can disable completely the cache by using `-Dvertx.disableFileCPResolving=true`. This setting is not without consequences. Vert.x would be unable to read any files from the classpath (only from the file system). Be -very careful when using this settings. +very careful when using this setting. diff --git a/src/main/asciidoc/net.adoc b/src/main/asciidoc/net.adoc index 300063679da..b8077e0eed8 100644 --- a/src/main/asciidoc/net.adoc +++ b/src/main/asciidoc/net.adoc @@ -347,9 +347,15 @@ TCP server (Net/Http) can be configured with traffic shaping options to enable b bandwidth can be limited through {@link io.vertx.core.net.TrafficShapingOptions}. For NetServer, traffic shaping options can be set through {@link io.vertx.core.net.NetServerOptions} and for HttpServer it can be set through {@link io.vertx.core.http.HttpServerOptions}. +[source,$lang] +---- {@link examples.NetExamples#configureTrafficShapingForNetServer} +---- +[source,$lang] +---- {@link examples.NetExamples#configureTrafficShapingForHttpServer} +---- [[ssl]] === Configuring servers and clients to work with SSL/TLS @@ -369,7 +375,7 @@ By default it is disabled. ==== Specifying key/certificate for the server -SSL/TLS servers usually provide certificates to clients in order verify their identity to clients. +SSL/TLS servers usually provide certificates to clients in order to verify their identity to clients. Certificates/keys can be configured for servers in several ways: @@ -807,7 +813,7 @@ OpenSSL to be installed on your OS depending on the tcnative implementation. === Using a proxy for client connections -The {@link io.vertx.core.net.NetClient} supports either a HTTP/1.x _CONNECT_, _SOCKS4a_ or _SOCKS5_ proxy. +The {@link io.vertx.core.net.NetClient} supports either an HTTP/1.x _CONNECT_, _SOCKS4a_ or _SOCKS5_ proxy. The proxy can be configured in the {@link io.vertx.core.net.NetClientOptions} by setting a {@link io.vertx.core.net.ProxyOptions} object containing proxy type, hostname, port and optionally username and password. diff --git a/src/main/asciidoc/streams.adoc b/src/main/asciidoc/streams.adoc index 6df8fc8c379..94aac890d71 100644 --- a/src/main/asciidoc/streams.adoc +++ b/src/main/asciidoc/streams.adoc @@ -119,7 +119,7 @@ Let's now look at the methods on `ReadStream` and `WriteStream` in more detail: `ReadStream` is implemented by {@link io.vertx.core.http.HttpClientResponse}, {@link io.vertx.core.datagram.DatagramSocket}, {@link io.vertx.core.http.HttpClientRequest}, {@link io.vertx.core.http.HttpServerFileUpload}, {@link io.vertx.core.http.HttpServerRequest}, {@link io.vertx.core.eventbus.MessageConsumer}, -{@link io.vertx.core.net.NetSocket}, {@link io.vertx.core.http.WebSocket}, {@link io.vertx.core.file.AsyncFile}. +{@link io.vertx.core.net.NetSocket}, {@link io.vertx.core.http.WebSocket} and {@link io.vertx.core.file.AsyncFile}. - {@link io.vertx.core.streams.ReadStream#handler}: set a handler which will receive items from the ReadStream.