From c5368cf85ecc079de03d64f2edeab3421d3f0436 Mon Sep 17 00:00:00 2001 From: mnemonikk Date: Wed, 8 Dec 2010 04:17:57 -0800 Subject: [PATCH] use defun/setq instead of define (elisp isn't scheme); use format instead of concat, the latter breaks when the service is passed as an integer Updated rcirc :connect-function fork (markdown) --- Home.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Home.md b/Home.md index 95d53ae..76a93cf 100644 --- a/Home.md +++ b/Home.md @@ -6,13 +6,20 @@ My fork of rcirc supports a new `:connect-function` parameter in `rcirc-server-a Connecting with SSL ------------------------------- +The easiest way to get started is using the function `open-tls-stream` +which is defined in the `tls` library. You need the `gnutls` binary for +this: + + (require 'tls) + (setq rcirc-server-alist '(("irc.freenode.net" :port 6697 :connect-function open-tls-stream :channels ("#rcirc")))) + This example defines a new `irc-open-tls-stream` function which calls out to the `socat` program to establish an SSL connection: (defun irc-open-tls-stream (name buffer host service) (start-process name buffer "socat" "STDIO" (concat "OPENSSL:" host ":" service ",verify=0"))) - (define rcirc-server-alist '(("irc.freenode.net" :port 6697 :connect-function irc-open-tls-stream :channels ("#rcirc")))) + (setq rcirc-server-alist '(("irc.freenode.net" :port 6697 :connect-function irc-open-tls-stream :channels ("#rcirc")))) Connecting through an HTTP proxy --------------------------------------------------- @@ -20,10 +27,10 @@ Connecting through an HTTP proxy The `proxychains` program does some magic tricks to get network activity to go out through an HTTP proxy. This example uses `proxychains` in front of `socat` to make a plain (non-SSL) connection: - (define irc-open-proxied-stream (name buffer host service) - (start-process name buffer "proxychains" "socat" "STDIO" (concat "TCP:" host ":" service))) + (defun irc-open-proxied-stream (name buffer host service) + (start-process name buffer "proxychains" "socat" "STDIO" (format "OPENSSL:%s:%d,verify=0" host service))) - (define rcirc-server-alist '(("irc.freenode.net" :connect-function irc-open-proxied-stream :channels ("#rcirc")))) + (setq rcirc-server-alist '(("irc.freenode.net" :connect-function irc-open-proxied-stream :channels ("#rcirc")))) Connecting with SSL, presenting a client certificate, with an SSH connection to a remote server ----------------------------------------------------------------- @@ -32,8 +39,8 @@ This crazy example (which I actually use) first establshes an SSH connection to from that machine, presenting a client certificate to the IRC server to authenticate. It also makes sure the remote host presents a valid SSL certificate. - (define irc-open-crazy-stream (name buffer host service) + (defun irc-open-crazy-stream (name buffer host service) (start-process name buffer "ssh" "remotehost" "socat" "STDIO" - (concat "OPENSSL:" host ":" service ",cert=/home/neale/ircauth.key,cafile=/home/neale/irc.pem"))) + (format "OPENSSL:%s:%d,cert=/home/neale/ircauth.key,cafile=/home/neale/irc.pem" host service))) - (define rcirc-server-alist '(("irc.wotzit.net" :port 994 :connect-function irc-open-crazy-stream))) + (setq rcirc-server-alist '(("irc.wotzit.net" :port 994 :connect-function irc-open-crazy-stream)))