Я пытаюсь подключиться к «серверу Stomp» и инициализировал соединение, однако мой код застрял на Stomp: Открытие Web Socket в течение примерно 5 минут, а затем, наконец, говорит, что соединение не удалось. Я успешно попытался связаться с Python (мой основной язык), однако мой друг хотел, чтобы подключение было добавлено на его веб -сайт, поэтому я подумал с моим очень небольшим опытом, я бы попробовал. Я полагаю, что Brokerurl является правильным, так как ранее он мгновенно провалил связь, тогда как теперь он провалится через 5 минут. />EDIT: I have used wireshark to monitor the data being sent back and forth, and have noticed that when the below code runs, it does a GET / HTTP 1.1 request, which doesnt happen when I run the python equivalent, and the next packet monitored is the connection being rejected so im even more lost
Here is my code to connect:
let stompClient;
const stompConfig = {
brokerURL: "ws://xxx.xx.xx.xxx:port",
// Keep it off for production, it can be quit verbose
// Skip this key to disable
debug: function (str) {
console.log('STOMP: ' + str);
},
// If disconnected, it will retry after 200ms
reconnectDelay: 200,
// Subscriptions should be done inside onConnect as those need to reinstated when the broker reconnects
onConnect: function (frame) {
// The return object has a method called `unsubscribe`
const subscription = stompClient.subscribe('/topic/TD_ALL_SIG_AREA', function (message) {
const payload = JSON.parse(message.body);
console.log(payload)
})
console.log("Connected to Simsig!")
stompClient.publish({destination: '/topic/TD_ALL_SIG_AREA', body: "{snapshot:{}}"});
}
}
// Create an instance
stompClient = new StompJs.Client(stompConfig);
// You can set additional configuration options here
// Attempt to connect
stompClient.activate();
Подробнее здесь: https://stackoverflow.com/questions/796 ... nt-connect
Клиент JS Stomp не подключается ⇐ Html
Программисты Html
1748451605
Anonymous
Я пытаюсь подключиться к «серверу Stomp» и инициализировал соединение, однако мой код застрял на Stomp: Открытие Web Socket в течение примерно 5 минут, а затем, наконец, говорит, что соединение не удалось. Я успешно попытался связаться с Python (мой основной язык), однако мой друг хотел, чтобы подключение было добавлено на его веб -сайт, поэтому я подумал с моим очень небольшим опытом, я бы попробовал. Я полагаю, что Brokerurl является правильным, так как ранее он мгновенно провалил связь, тогда как теперь он провалится через 5 минут. />EDIT: I have used wireshark to monitor the data being sent back and forth, and have noticed that when the below code runs, it does a GET / HTTP 1.1 request, which doesnt happen when I run the python equivalent, and the next packet monitored is the connection being rejected so im even more lost
Here is my code to connect:
let stompClient;
const stompConfig = {
brokerURL: "ws://xxx.xx.xx.xxx:port",
// Keep it off for production, it can be quit verbose
// Skip this key to disable
debug: function (str) {
console.log('STOMP: ' + str);
},
// If disconnected, it will retry after 200ms
reconnectDelay: 200,
// Subscriptions should be done inside onConnect as those need to reinstated when the broker reconnects
onConnect: function (frame) {
// The return object has a method called `unsubscribe`
const subscription = stompClient.subscribe('/topic/TD_ALL_SIG_AREA', function (message) {
const payload = JSON.parse(message.body);
console.log(payload)
})
console.log("Connected to Simsig!")
stompClient.publish({destination: '/topic/TD_ALL_SIG_AREA', body: "{snapshot:{}}"});
}
}
// Create an instance
stompClient = new StompJs.Client(stompConfig);
// You can set additional configuration options here
// Attempt to connect
stompClient.activate();
Подробнее здесь: [url]https://stackoverflow.com/questions/79641305/js-stomp-client-wont-connect[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия