2020/4/30 JJUGナイトセミナー「みんなの小噺」での登壇資料です
![JavaでHTTPアクセスしてみる / HTTP access with Java](https://cdn-ak-scissors.b.st-hatena.com/image/square/7d6ee54806a3b628e9b9f708a22111c465c9f3e4/height=288;version=1;width=512/https%3A%2F%2Ffiles.speakerdeck.com%2Fpresentations%2F9defb6614e014499acf58c07cfd2b909%2Fslide_0.jpg%3F15383532)
Full-featured local proxy tool Save all captured packets (i.e., requests and responses) and show them in the history tab Filter/Search packets in the history tab (e.g. requests==/api/v1/users to show only requests whose path contains /api/v1/users ) Modify the contents of intercepted packets before forwarding them to the destination Resend (or replay) captured packets with or without manually modi
こんにちは、SSTでWeb脆弱性診断用のツール(スキャンツール)開発をしている坂本(Twitter, GitHub)です。 普段は診断向けのスキャンツールを開発していますが、今年(2019年)の3月~8月にかけて、SST内部で使用する独自ローカルHTTPプロキシ「spindle-localproxy」を開発しました。 本記事(Part2)では公開しても差し支えない範囲で技術的な内容を紹介します。 開発の経緯や簡単な機能説明については、 Part1 を参照してください。 (以下、特に断りがない場合は「ローカルHTTPプロキシ」を「HTTPプロキシ」と表記します。) Part2. 技術的な内容紹介 今回開発したHTTPプロキシは、診断サービスの事前調査における画面遷移図作成をサポートする社内ツールになります。 Part2 では技術選定や要件で考慮したポイント、HTTPプロキシの実装とWebSo
Easy mocking of any system you integrate with via HTTP or HTTPS Getting Started To get started see the guide for mocking or proxying or the code examples. What is MockServer For any system you integrate with via HTTP or HTTPS MockServer can be used as: a mock configured to return specific responses for different requests a proxy recording and optionally modifying requests and responses both a prox
Undertow is a flexible performant web server written in java, providing both blocking and non-blocking API’s based on NIO. Undertow has a composition based architecture that allows you to build a web server by combining small single purpose handlers. The gives you the flexibility to choose between a full Java EE servlet 4.0 container, or a low level non-blocking handler, to anything in between. Un
はじめに 『Javaによる簡易HTTPサーバーの作成』第4回目の今回は、クライアントとの通信に、これまで利用してきたSocketではなく、NIOで提供されるSocketChannelを利用します。 Socketでは、実際の入出力にはStreamを利用します。この時、例えばInputStream#readを呼び出すと、データが読み込み可能になるか例外になるまではreadメソッドから制御が戻りません。そのため、同時に複数のクライアントからの要求を処理するためには、クライアントごとにスレッドを利用する必要がありました。 これに対して、SocketChannelを非ブロックモードで利用すると、まだデータが到達していない、あるいはシステムの送信用バッファがフルになっているなどの理由でデータを転送できない時には、制御が呼び出し側に戻されます(これをJ2SEのAPIドキュメントでは「非ブロック接続」と呼
Overview Features Recipes Security Works with OkHttp API Change Logs Contributing OkHttp¶ HTTP is the way modern applications network. It’s how we exchange data & media. Doing HTTP efficiently makes your stuff load faster and saves bandwidth. OkHttp is an HTTP client that’s efficient by default: HTTP/2 support allows all requests to the same host to share a socket. Connection pooling reduces reque
Pluggable HTTP Transport The HTTP library has a fully pluggable HTTP transport layer that allows you to build on top of the low-level HTTP of your choice and optimize for the Java platform your application is running on. Thanks to this abstraction, code written for one platform works across all supported platforms, from mobile applications such as those built for Android, to installed applications
このページの目的は、 Webアプリケーションの基礎の基礎を説明することです。 さて、ここから下のぐだぐだは読み飛ばして、 いきなり実装の説明に 行ってもらってもかまいませんが、一応趣旨を書いておきます。 現在、プロのプログラマーの方々には、日々の仕事でせっせと 「Webアプリケーション」を作っている人が多いと思います。 そして、いまどきWebアプリケーションを作るのに、 CGIとかあり得ないでしょうから、 それなりの高級言語で、 それなりのフレームワーク等を使用して作っているのだと思います。 私自身、現状、仕事では主にC#とASP.NETを使っています。 そうやって生産性を上げるのは大変よいことだと思うのですが、 ことWebアプリケーションにおいては、 そのような「一見簡単そう」なフレームワークを使っても、 ちょっとややこしいことをやろうとするとすぐにうまくいかなくなって、 職場の先輩に聞
id:ikikko さんのこちらの記事を参考にJavaでHTTPアクセスを記録/再生してテスト時に使える、Betamaxを試してみました。 このBetamaxというのはその名の通り、テープに記録/再生するものなわけですが、その対象が映像ではなくHTTPアクセスだと言うことです。 Rubyでvcrという同様のツールがあるのですが、こちらのクローンとなります。Betamxを使ったテストのメリットとして ネットに繋げる必要がない 状態を固定できる(検索結果などアクセス毎に変わるものに有効) レアケースのテストに対応できる モックを用意する必要がない というのがあげられます。モックを用意しなくて良いので、テスト全体もシンプルになりますし、WebAPIを始め外部のリソースを叩くときにはかなり汎用的に活用できそうです。 基本的な仕組みはJettyベースのProxyを立ち上げて、Javaの標準Proxy
Betamax is a tool for mocking external HTTP resources such as web services and REST APIs in your testsRecord & replay HTTP traffic for simple, reliable tests. Betamax Introduction Versions Installation Usage Compatibility HTTPS Configuration Caveats Examples About Introduction Betamax is a tool for mocking external HTTP resources such as web services and REST APIs in your tests. The project was in
ちょっとJVMってかMBeanの情報をぶっこぬくツールを作る必要があって、最初jythonで作ったんだけどjythonにはいろいろ失望した。で、同僚にJolokiaってのがあると教えてもらったのですが、これがなかなかイケてる。Jolokiaというのは、簡単に言うと、MBeanにHTTP経由でアクセスできるようにjmxの口を空けてくれるJavaのエージェント。こいつをJavaプログラムやJavaなミドルウェアに仕込んでやるだけでHTTPの口が空いて、そこ経由でいろいろできる。レスポンスはJSONで帰ってくる。 Cassandraの記事はまた次回www まぁ、今回もJolokiaに手を出したのもCassandra起因なんだけどね。Cassandraはレイテンシやリード/ライト数がMBeanに格納されてて、そいつを抜いてグラフ描画させたいなぁ、と。Cassandraのマネジメントツールとしては、
I am trying to mimic the functionality of this curl command in Java: curl --basic --user username:password -d "" http://ipaddress/test/login I wrote the following using Commons HttpClient 3.0 but somehow ended up getting an 500 Internal Server Error from the server. Can someone tell me if I'm doing anything wrong? public class HttpBasicAuth { private static final String ENCODING = "UTF-8"; /** * @
The page you are trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.
「DefaultHttpClientを使ってコンテンツを取得する」でWeb上のコンテンツを取得する方法を説明しました。 DefalutHttpClientではURLを指定してコンテンツを取得することが可能ですが、場合によってはそのURLにアクセスするには認証が必要なことがあります。 今回はBasic認証が必要なURLにアクセスしてコンテンツを取得する方法を説明します。 それでは続きからどうぞ 認証情報とスコープ DefalutHttpClientに認証情報(ユーザー名とパスワード)とその認証を行うスコープを設定することでBasic認証でのアクセスが可能になります。 認証情報(ユーザーIDとパスワード)はCredentialsインタフェースを実装したクラス、スコープはAuthScopeクラスが担います。 Credentialsインタフェースを実装したクラスには NTCredentials:N
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く