;;; tramp-gw.el --- Tramp utility functions for HTTP tunnels and SOCKS gateways
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
(when (featurep 'xemacs)
(byte-compiler-options (warnings (- unused-vars)))))
+;; We don't add the following methods to `tramp-methods', in order to
+;; exclude them from file name completion.
+
;; Define HTTP tunnel method ...
;;;###tramp-autoload
(defconst tramp-gw-tunnel-method "tunnel"
- "*Method to connect HTTP gateways.")
+ "Method to connect HTTP gateways.")
;; ... and port.
(defconst tramp-gw-default-tunnel-port 8080
- "*Default port for HTTP gateways.")
+ "Default port for HTTP gateways.")
;; Define SOCKS method ...
;;;###tramp-autoload
(defconst tramp-gw-socks-method "socks"
- "*Method to connect SOCKS servers.")
+ "Method to connect SOCKS servers.")
;; ... and port.
(defconst tramp-gw-default-socks-port 1080
- "*Default port for SOCKS servers.")
+ "Default port for SOCKS servers.")
;; Autoload the socks library. It is used only when we access a SOCKS server.
(autoload 'socks-open-network-stream "socks")
(list "Default server" "socks" tramp-gw-default-socks-port 5))
;; Add a default for `tramp-default-user-alist'. Default is the local user.
-(add-to-list 'tramp-default-user-alist
- `(,tramp-gw-tunnel-method nil ,(user-login-name)))
-(add-to-list 'tramp-default-user-alist
- `(,tramp-gw-socks-method nil ,(user-login-name)))
+;;;###tramp-autoload
+(add-to-list
+ 'tramp-default-user-alist
+ (list (concat "\\`"
+ (regexp-opt (list tramp-gw-tunnel-method tramp-gw-socks-method))
+ "\\'")
+ nil (user-login-name)))
;; Internal file name functions and variables.
(memq (process-status tramp-gw-aux-proc) '(listen)))
(let ((aux-vec
(vector "aux" (tramp-file-name-user gw-vec)
- (tramp-file-name-host gw-vec) nil)))
+ (tramp-file-name-host gw-vec) nil nil)))
(setq tramp-gw-aux-proc
(make-network-process
:name (tramp-buffer-name aux-vec) :buffer nil :host 'local
(tramp-file-name-host gw-vec)))
;; Declare the SOCKS server to be used.
(socks-server
- (list "Tramp tempory socks server list"
+ (list "Tramp temporary socks server list"
;; Host name.
(tramp-file-name-real-host gw-vec)
;; Port number.
(setq tramp-gw-gw-proc
(funcall
socks-function
- (tramp-buffer-name gw-vec)
- (tramp-get-buffer gw-vec)
+ (tramp-get-connection-name gw-vec)
+ (tramp-get-connection-buffer gw-vec)
(tramp-file-name-real-host target-vec)
(tramp-file-name-port target-vec)))
(set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
;; * Provide descriptive Commentary.
;; * Enable it for several gateway processes in parallel.
-;; arch-tag: 277e3a81-fdee-40cf-9e6b-59626292a5e0
;;; tramp-gw.el ends here