るりまサーチ

最速Rubyリファレンスマニュアル検索!
180件ヒット [101-180件を表示] (0.025秒)

別のキーワード

  1. socket eai_protocol
  2. wks protocol
  3. cloud protocol
  4. cloud protocol=
  5. rss protocol

ライブラリ

キーワード

検索結果

<< < 1 2 >>

cgi (132.0)

CGI プログラムの支援ライブラリです。

...) Version 1.1
* https://www.w3.org/CGI/

=== 使用例

==== フォームフィールドの値を得る

//emlist[][ruby]{
require "cgi"
cgi = CGI.new
values = cgi['field_name'] # <== 'field_name' の配列
# 'field_name' が指定されていなかったら、 ""を返す。
fields = cgi.keys...
...gi = CGI.new
params = cgi.params
//}

また CGI#params は毎回同じ Hash オブジェクトを返すので
以下のような使いかたもできます。

//emlist[][ruby]{
cgi.params['new_field_name'] = ["value"] # 新しいパラメータを加える
cgi.params['field_name'] = ["new_value"]...
...NG
* REMOTE_ADDR
* REMOTE_HOST
* REMOTE_IDENT
* REMOTE_USER
* REQUEST_METHOD
* SCRIPT_NAME
* SERVER_NAME
* SERVER_PORT
* SERVER_PROTOCOL
* SERVER_SOFTWARE

#content_length と #server_port
は整数を、その他のメソッドは文字列を返します。

HTTP_COOKIE と HTTP...

xmlrpc (54.0)

XML-RPC を扱うためのライブラリです。

...and Copyright

Copyright (C) 2001-2004 by Michael Neumann

Released under the same term of license as Ruby.

=== Overview

XMLRPC is a lightweight protocol that enables remote procedure calls over
HTTP. It is defined at http://www.xmlrpc.com.

XMLRPC allows you to create simple distributed computin...
...e

Try the following code. It calls a standard demonstration remote procedure.

require 'xmlrpc/client'
require 'pp'

server = XMLRPC::Client.new2("http://xmlrpc-c.sourceforge.net/api/sample.php")
result = server.call("sample.sumAndDifference", 5, 3)
pp result

=== Documentation

See http...
...* Apache mod_ruby server
* WEBrick servlet

* Client
* synchronous/asynchronous calls
* Basic HTTP-401 Authentification
* HTTPS protocol (SSL)

* Parsers
* NQXML (NQXMLStreamParser, NQXMLTreeParser)
* Expat (XMLStreamParser, XMLTreeParser)
* REXML (REXMLStreamParser)...

OpenSSL::OCSP (40.0)

OCSP(Online Certificate Status Protocol)を取り扱うための モジュールです。OCSP は 2560 で定義されています。

...OCSP(Online Certificate Status Protocol)を取り扱うための
モジュールです。OCSP は 2560 で定義されています。

このモジュールは OCSP のリクエストとレスポンスを取り扱う
機能を持っています。

OCSP レスポンダと通信する機能はあり...
...ト)
store # 信頼している証明書ストア
cid = OpenSSL::OCSP::CertificateId.new(subject, issuer)
req = OpenSSL::OCSP::Request.new
req.add_certid(cid)
req.add_nonce

http = Net::HTTP.new('ocsp.example.com', 80)
httpres = http.post("/", req.to_der, 'content-type' => 'applicati...
...on/ocsp-request')
raise "HTTP error" if !httpres.kind_of?(Net::HTTPOK)
res = OpenSSL::OCSP::Response.new(httpres.body)

puts "Response status: #{res.status_string}"
exit if res.status != OpenSSL::OCSP::RESPONSE_STATUS_SUCCESSFUL

basic_resp = res.basic
raise "nonce error" unless [-1, 1...

net/imap (40.0)

このライブラリは Internet Message Access Protocol (IMAP) の クライアントライブラリです。2060 を元に 実装されています。

...このライブラリは Internet Message Access Protocol (IMAP) の
クライアントライブラリです。2060 を元に
実装されています。

=== IMAP の概要

IMAPを利用するには、まずサーバに接続し、
Net::IMAP#authenticate もしくは
Net::IMAP#login で認証し...
...=== 例

デフォルトのメールボックス(INBOX)の送り元とサブジェクトを表示する。
require 'net/imap'

imap = Net::IMAP.new('mail.example.com')
imap.authenticate('LOGIN', 'joe_user', 'joes_password')
imap.examine('INBOX')
imap.search(["RECENT"]).each do |message_id...
...ct}"
end

2003年4月のメールをすべて Mail/sent-mail から "Mail/sent-apr03" へ移動させる

require 'net/imap'

imap = Net::IMAP.new('mail.example.com')
imap.authenticate('LOGIN', 'joe_user', 'joes_password')
imap.select('Mail/sent-mail')
if not imap.list('Mail/', 'sent-apr...

net/pop (34.0)

このライブラリは、POP3 (Post Office Protocol version 3) を 用いてPOPサーバからメールを受信する機能を提供するライブラリです。

...このライブラリは、POP3 (Post Office Protocol version 3) を
用いてPOPサーバからメールを受信する機能を提供するライブラリです。

POP3 の実装は 1939 に基いています。

2449 で定義されているPOP3拡張には対応していません。
=== 使用...
...'YourPassword' は適当なアカウント名とパスワード
に適宜読みかえてください。

require 'net/pop'

pop = Net::POP3.new('pop.example.com', 110)
pop.start('YourAccount', 'YourPassword') # POPのセッションを開始
if pop.mails.empty?
$stderr.puts 'no mail.'...
...省略や短縮用メソッドを避けたためにかなり冗長です。
まず、ブロック付きの Net::POP3.start を使うことで
POP3.new, #start, #finish を併合できます。

require 'net/pop'

Net::POP3.start('pop.example.com', 110,
'YourAccount', 'YourPas...

絞り込み条件を変える

net/smtp (28.0)

メールを送信するためのプロトコル SMTP (Simple Mail Transfer Protocol) を扱うライブラリです。

...メールを送信するためのプロトコル SMTP (Simple Mail Transfer Protocol)
を扱うライブラリです。

ヘッダなどメールのデータを扱うことはできません。
SMTP の実装は 2821 に基いています。

=== 使用例

==== とにかくメールを送る

SMTP...
...証する
必要がある場合は別の方法を考える必要があるでしょう。

require 'net/smtp'
# STARTTLSの例
smtp = Net::SMTP.new('smtp.example.com', 25)
# SSLのコンテキストを作成してSSLの設定をし、context に代入しておく
# TLSを常に使うよう...
...
smtp.enable_starttls(context)
smtp.start() do
# send messages ...
end

TLS を使用したい場合は enable_tls を使用します。

require 'net/smtp'
# TLSの例
smtp = Net::SMTP.new('smtp.example.com', 465)
smtp.enable_tls
smtp.start do
# send messages ...
end...
...があるでしょう。


TLS を使用したい場合は enable_tls を使用します。

require 'net/smtp'
# TLSの例
smtp = Net::SMTP.new('smtp.example.com', 465)
smtp.enable_tls
smtp.start do
# send messages ...
end

サーバーが STARTTLS をサポートしている場合...
...くない場合は Net::SMTP#disable_starttls を使用します。

require 'net/smtp'
# STARTTLSを使用したくない例
smtp = Net::SMTP.new('smtp.example.com', 25)
smtp.disable_starttls
smtp.start do
# send messages ...
end

デフォルトではサーバー証明書の検証...

Addrinfo.ip(host) -> Addrinfo (12.0)

IP アドレスに対する Addrinfo オブジェクトを返します。

...socktype, protocol は 0 で初期化されます。
つまりこの返り値はソケットを生成するには不適です。

require 'socket'

Addrinfo.ip("localhost") #=> #<Addrinfo: 127.0.0.1 (localhost)>

@param host ホスト(IP アドレスもしくはホスト名)
@see Addrinfo.new...

BasicSocket#remote_address -> Addrinfo (12.0)

getpeername(2) で得られたリモートアドレス情報を Addrinfo オブジェクトとして返します。

...トの Addrinfo#protocol は 0 を
返すことに注意してください。

require 'socket'

TCPSocket.open("www.ruby-lang.org", 80) {|s|
p s.remote_address #=> #<Addrinfo: 221.186.184.68:80 TCP>
}

TCPServer.open("127.0.0.1", 1728) {|serv|
c = TCPSocket.new("127.0.0.1", 1728)...
<< < 1 2 >>