如何在 Squeak 或 Pharo 中发出 HTTPS 请求?

发布于 2024-10-08 02:45:01 字数 81 浏览 4 评论 0原文

如何从 Squeak 或 Pharo 发出 HTTPS 请求? HTTPClient 和朋友们似乎缺乏任何 SSL 设施。

How can I make an HTTPS request from Squeak or Pharo? HTTPClient and friends seem to lack any facilities for SSL.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

日暮斜阳 2024-10-15 02:45:01

您可以通过 WebClient 轻松使用 SqueakSSL,如下所示:

WebClient httpGet:
'https://www.google.com/search?q=squeak'。< /p>

证书可能有问题,在这种情况下,您必须捕获并忽略错误(

另外,请密切关注 Zinc http 框架,它将很快成为 Pharo 的新默认框架。好像还没有ssl,但是正在快速开发中。

You can use SqueakSSL easily through WebClient like so:

WebClient httpGet:
'https://www.google.com/search?q=squeak'.

There may be a problem with certificates, in which case you will have to catch and ignore the errors (see here).

Also, keep your eye on the Zinc http framework, which will be Pharo's new default soon. It doesn't seem to have ssl yet, but it's being rapidly developed.

旧伤还要旧人安 2024-10-15 02:45:01

如上所述的 Zodiac 将使您能够从 Zinc 发出 HTTPS 请求。

像这样启用它(来自Pharo论坛的食谱):

首先下载SqueakSSL 插件并将其放入您的 Pharo 目录中,然后加载必要的包:

"Load Zinc HTTP Components"
Gofer it 
  squeaksource: 'ZincHTTPComponents'; 
  package: 'Zinc-HTTP'; 
  package: 'Zinc-Tests'; 
  package: 'Zinc-Patch-HTTPSocket'; 
  load. 

"Load Zodiac including extras"
Gofer it 
  squeaksource: 'Zodiac'; 
  package: 'Zodiac-Core'; 
  package: 'Zodiac-Tests'; 
  load. 

"Load extra Zinc support for Zodiac"
Gofer it 
  squeaksource: 'ZincHTTPComponents'; 
  package: 'Zinc-Zodiac'; 
  load. 

"Switch to the Zn Zodiac socket factory" 
ZnNetworkingUtils default: ZnZodiacNetworkingUtils new. 

您应该能够针对 HTTPS 资源发出请求。

Zodiac as mentioned above will enable you to make HTTPS requests from Zinc.

Enable it like this (recipe from the Pharo forum):

First download the SqueakSSL plugin and put it in your Pharo directory, and then load the necessary packages:

"Load Zinc HTTP Components"
Gofer it 
  squeaksource: 'ZincHTTPComponents'; 
  package: 'Zinc-HTTP'; 
  package: 'Zinc-Tests'; 
  package: 'Zinc-Patch-HTTPSocket'; 
  load. 

"Load Zodiac including extras"
Gofer it 
  squeaksource: 'Zodiac'; 
  package: 'Zodiac-Core'; 
  package: 'Zodiac-Tests'; 
  load. 

"Load extra Zinc support for Zodiac"
Gofer it 
  squeaksource: 'ZincHTTPComponents'; 
  package: 'Zinc-Zodiac'; 
  load. 

"Switch to the Zn Zodiac socket factory" 
ZnNetworkingUtils default: ZnZodiacNetworkingUtils new. 

And you should be able to make requests against HTTPS resources.

七七 2024-10-15 02:45:01

邮件列表上有一些讨论。 简而言之:

< a href="http://squeakingalong.wordpress.com/2010/07/19/squeakssl-released/" rel="nofollow">SqueakSSL 应该可以完成这项工作,但可能需要一些修复。 它可以通过 WebClient 调用,正如 Sean Denigris 指出的:

WebClient httpGet: 'https://www.google.com/search?q=squeak'.

并且,从邮件列表中:

如果您知道要连接到谁,那么您可以使用 stunnel。

There was a bit of discussion on the mailing list. In short:

SqueakSSL is supposed to do the job, but may need some fixing. It can be invoked through WebClient, as Sean Denigris noted:

WebClient httpGet: 'https://www.google.com/search?q=squeak'.

And, from the mailing list:

If you know whom you want to connect to, then you can use stunnel.

橙幽之幻 2024-10-15 02:45:01

在生产环境中,我们只需使用 Lighttpd(或 Apache)将 http 转换为 https

In a production environment we just use Lighttpd (or Apache) to translate from http to https

像你 2024-10-15 02:45:01

您可能想使用隧道。

为什么?

将 CPU 密集型加密/解密任务完全外包给本机库,并完全释放虚拟机的压力。

另一方面,您可能需要关注由 Zodiac 启动的 Zodiac /forum.world.st/SSL-HTTPS-SecureSocketStream-SSLSession-for-Pharo-Squeak-and-other-Smalltalk-implementations-td3517404.html" rel="nofollow">此举措

You might want to use stunnel.

Why?

To outsource completely the CPU intensive encryption/decryption tasks to a native library and free the VM of that stress at all.

In the other hand, you might want to keep an eye on Zodiac that started by this initiative

与之呼应 2024-10-15 02:45:01

在最近的 Pharo 图像中,由于锌和 Zodiac 集成在一起,支撑效果要好得多。
只需评估

ZnEasy get: 'https://www.google.com'

例如。

详细文档可以在这里找到:

http://www.pharo -project.org/news?dialog=documentation-for-zinc-http

对于 HTTPS 客户端、安全 POP 客户端、安全 SMTP 客户端
阅读

http://zdc.stfx.eu/zodiac-paper.html

In recent Pharo images the support is much better since Zinc and Zodiac are integrated.
Just evaluate

ZnEasy get: 'https://www.google.com'

for example.

A detailed docu can be found here:

http://www.pharo-project.org/news?dialog=documentation-for-zinc-http

For HTTPS client, Secure POP client, Secure SMTP client
read

http://zdc.stfx.eu/zodiac-paper.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文