Skip to content

Instantly share code, notes, and snippets.

View BMLande's full-sized avatar
👨‍💻
Asgardian coder

Bhagvat Lande BMLande

👨‍💻
Asgardian coder
View GitHub Profile
@BMLande
BMLande / webSocket.service.ts
Created February 7, 2019 07:32
Websocket Service
import { Injectable } from '@angular/core';
import * as Stomp from 'stompjs';
import * as SockJS from 'sockjs-client';
@Injectable({ providedIn: 'root' })
export class WebSocketService {
//connect to websocket server
public connect() {
let socket = new SockJS("http://192.168.1.9:8080/websocketapp");
let stompClient = Stomp.over(socket);