Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[event-hubs] Fixing websockets sample to line up with Service Bus #9613

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/eventhub/event-hubs/samples/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"homepage": "https://github.com/Azure/azure-sdk-for-js#readme",
"sideEffects": false,
"dependencies": {
"@azure/core-amqp": "next",
"@azure/event-hubs": "next",
"@azure/core-amqp": "latest",
"@azure/event-hubs": "latest",
"@types/dotenv": "^8.2.0",
"@types/ws": "^6.0.4",
"dotenv": "^8.2.0",
Expand Down
5 changes: 2 additions & 3 deletions sdk/eventhub/event-hubs/samples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
"homepage": "https://github.com/Azure/azure-sdk-for-js#readme",
"sideEffects": false,
"dependencies": {
"@azure/core-amqp": "next",
"@azure/event-hubs": "next",
"@types/dotenv": "^8.2.0",
"@azure/core-amqp": "latest",
"@azure/event-hubs": "latest",
"@types/ws": "^6.0.4",
"dotenv": "^8.2.0",
"https-proxy-agent": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/eventhub/event-hubs/samples/typescript/src/websockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import WebSocket from "ws";
const url = require("url");
const httpsProxyAgent = require("https-proxy-agent");
import { HttpsProxyAgent } from "https-proxy-agent";

import { EventHubConsumerClient } from "@azure/event-hubs";

Expand All @@ -34,7 +34,7 @@ const consumerGroup = process.env["CONSUMER_GROUP_NAME"] || "";
// Skip this section if you are not behind a proxy server
const urlParts = url.parse("http://localhost:3128");
urlParts.auth = "username:password"; // Skip this if proxy server does not need authentication.
const proxyAgent = new httpsProxyAgent(urlParts);
const proxyAgent = new HttpsProxyAgent(urlParts);

export async function main(): Promise<void> {
console.log(`Running websockets sample`);
Expand Down
1 change: 1 addition & 0 deletions sdk/eventhub/event-hubs/samples/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"moduleResolution": "node",

"allowSyntheticDefaultImports": true,
"esModuleInterop": true,

"outDir": "dist",
"rootDir": "src"
Expand Down