Direct Functions (Gnus Manual)

Next: , Up: NNTP [Contents][Index]


7.2.1.1 Direct Functions

These functions are called direct because they open a direct connection between your machine and the NNTP server. The behavior of these functions is also affected by commonly understood variables (see Common Variables).

nntp-open-network-stream

This is the default, and simply connects to some port or other on the remote system. If both Emacs and the server supports it, the connection will be upgraded to an encrypted STARTTLS connection automatically. If you want to avoid the possibility of a malicious intermediary blocking the use of STARTTLS, use nntp-open-tls-stream instead.

nntp-open-plain-stream
network-only

The same as the above, but don’t do automatic STARTTLS upgrades. Only use this if you want anyone to be able to read your traffic.

nntp-open-tls-stream

Opens a connection to a server over a secure channel. To use this, your Emacs must have been compiled with GnuTLS support GnuTLS. You can check this using the gnutls-available-p command.

You then define a server as follows:

;; "nntps" is port 563 and is predefined in our /etc/services
;; however, ‘gnutls-cli -p’ doesn’t like named ports.
;;
(nntp "snews.bar.com"
 (nntp-open-connection-function nntp-open-tls-stream)
 (nntp-port-number 563)
 (nntp-address "snews.bar.com"))
nntp-open-ssl-stream

This is the old name for nntp-open-tls-stream, and is completely equivalent.

nntp-open-netcat-stream

Opens a connection to an NNTP server using the netcat program. You might wonder why this function exists, since we have the default nntp-open-network-stream which would do the job. (One of) the reason(s) is that if you are behind a firewall but have direct connections to the outside world thanks to a command wrapper like runsocks, you can use it like this:

(nntp "socksified"
 (nntp-pre-command "runsocks")
 (nntp-open-connection-function nntp-open-netcat-stream)
 (nntp-address "the.news.server"))

With the default method, you would need to wrap your whole Emacs session, which is not a good idea.

nntp-open-telnet-stream

Like nntp-open-netcat-stream, but uses telnet rather than netcat. telnet is a bit less robust because of things like line-end-conversion, but sometimes netcat is simply not available. The previous example would turn into:

(nntp "socksified"
 (nntp-pre-command "runsocks")
 (nntp-open-connection-function nntp-open-telnet-stream)
 (nntp-address "the.news.server")
 (nntp-end-of-line "\n"))

Next: Indirect Functions, Up: NNTP [Contents][Index]

AltStyle によって変換されたページ (->オリジナル) /